Comment 3 for bug 1241926

Revision history for this message
Martin Babutzka (martin-babutzka) wrote :

Please take this bug serious and report it upstream because whatever is the technical reason for this Java VM behaviour - it needs to be fixed.

Running a usual remote multi-user x86-64 Linux machine I can confirm this GIANT bug and provide additional information:

- This bug applies to all Java versions I tested so far (OpenJDK 6-8, Oracle Java 6-8). The consequences of the bug are excessive and posted several times on the web without a reasonable reaction (e.g. https://bugzilla.redhat.com/show_bug.cgi?id=510344) - except telling the people to provide an artificial memory limit to java directly via -Xmx.

- The bug occurs when the virtual memory limit (ulimit -v) is set below 30% of the total memory available on the system. On large servers the required minimum memory limit becomes huge(!)

- This bug happens with even the simplest java programs among them are the execution of "java -version" or the Hello World example from https://en.wikipedia.org/wiki/Java_%28programming_language%29 .

Example (Server has 48 GB memory):
> ulimit -v 16777216
> java -version
OpenJDK Runtime Environment (IcedTea 2.5.3) (7u71-2.5.3-0ubuntu0.14.04.1)
OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)

> ulimit -v 12000000
> 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.

> java -Xmx2m -version
java version "1.7.0_65"
OpenJDK Runtime Environment (IcedTea 2.5.3) (7u71-2.5.3-0ubuntu0.14.04.1)
OpenJDK 64-Bit Server VM (build 24.65-b04, mixed mode)
--> java -version should run with 2 MB of virtual memory.

Its amazing! Java can't even allocate 12 GB of RAM in the time it needs to put out the out of memory error. I am really curious how it finds the limit so fast to crash. Java can therefore be not executed normally (without -Xmx) on any machine with a reasonable memory limit for users! This behaviour leads to many subsequent bugs in java-software (e.g. eclipse) that I found on the web.

Everyone knows that java is kind of a slow and crappy language but thats not an argument to allow the Java VM to crash if the Helloworld example can not reserve 15 GB of memory on a larger server(!) I have no idea how this bug could survive for that long.