因此,我在服务器上运行java -version
并得到:
Picked up _JAVA_OPTIONS: -Xmx256M
Error occurred during initialization of VM
Could not reserve enough space for code cache
我已经尝试通过执行以下操作来增加内存堆大小:
export _JAVA_OPTIONS="-Xmx4098M"
仍然出现相同的错误:
Picked up _JAVA_OPTIONS: -Xmx4098M
Error occurred during initialization of VM
Could not reserve enough space for code cache
系统信息:
NAME="Ubuntu"
VERSION="16.04.5 LTS (Xenial Xerus)"
PRETTY_NAME="Ubuntu 16.04.5 LTS"
VERSION_ID="16.04"
内存信息:
MemTotal: 16129980 kB
MemFree: 10867848 kB
MemAvailable: 13922472 kB
Buffers: 755304 kB
Cached: 2272096 kB
SwapCached: 0 kB
Active: 3589388 kB
Inactive: 1194280 kB
Active(anon): 1760772 kB
Inactive(anon): 6996 kB
Active(file): 1828616 kB
Inactive(file): 1187284 kB
Unevictable: 3652 kB
Mlocked: 3652 kB
SwapTotal: 0 kB
SwapFree: 0 kB
Dirty: 48 kB
AnonPages: 1762000 kB
Mapped: 99716 kB
Shmem: 9076 kB
Slab: 403864 kB
SReclaimable: 375876 kB
SUnreclaim: 27988 kB
KernelStack: 3600 kB
PageTables: 12404 kB
CommitLimit: 8064988 kB
Committed_AS: 2793580 kB
VmallocTotal: 34359738367 kB
Hugepagesize: 2048 kB
DirectMap4k: 90088 kB
DirectMap2M: 4845568 kB
DirectMap1G: 11534336 kB
命令ulimit
给了我unlimited
我也尝试过
paxctl -c -m /path/to/your/java/bin/java
仍然出现相同的错误。
注意:这个问题在ubuntu上越来越严重!!!不是窗户!!!