You are not logged in.
I have just installed from scratch on a new 64-bit machine and have noticed that something is stopping Java (jdk7-openjdk) from grabbing its default heap space:
>java -version
Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
I bit of binary chopping and I have discovered that 882M seems to be the maximum usable heap:
>java -Xmx882M -version
java version "1.7.0_51"
OpenJDK Runtime Environment (IcedTea 2.4.4) (ArchLinux build 7.u51_2.4.4-1-x86_64)
OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode)
>java -Xmx883M -version
#
# There is insufficient memory for the Java Runtime Environment to continue.
# pthread_getattr_np
# An error report file with more information is saved as:
# /tmp/hs_err_pid30550.log
java version "1.7.0_51"
OpenJDK Runtime Environment (IcedTea 2.4.4) (ArchLinux build 7.u51_2.4.4-1-x86_64)
OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode)
This computer has 8GB of RAM with an 8GB swap file, and currently just under 1GB is in use.
I have also tried this with Oracle JDK and the limit there was 972M.
These numbers are on the low side. What is limiting the amount of memory that the Java can grab? I have looked into ulimit and systemd-cgroups and neither seem to be limiting memory. I definitely haven't consciously done anything to limit maximum memory per process.
What else could be limiting Java?
Last edited by smeghead (2014-01-28 05:42:44)
Offline
I should add that the numbers stay the same even after a reboot, so there does seem to be some kind of hard limit in play here.
Offline
It was ulimit all along. If you run it with no parameters it returns "unlimited" which I assumed meant that there were no limits in place, but that is not correct - there was a 2GB limit on virtual memory:
>ulimit
unlimited
>ulimit -v
2097152
>ulimit -v unlimited
>ulimit -v
unlimited
>java -version
java version "1.7.0_51"
OpenJDK Runtime Environment (IcedTea 2.4.4) (ArchLinux build 7.u51_2.4.4-1-x86_64)
OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode)
Offline
Please don't use Closed: it denotes a locked thread. Use Resolved, or Solved instead.
Offline
Is this de default behavior or did you change the ulimit at some point?
Offline