#1457 JVMJ9VM015W Initialization error for library j9gc24(2): Fail

Unix::Linux
closed-fixed
5
2014-09-15
2012-05-22
bfurey
No

OS : Fedora 16 (32 bit)

On a machine that has 8GB of RAM, the STAX service is allocated 2.5GB of memory as per the following entry in the STAF.cfg file. I have also seen this on a machine with 12GB memory.

#Load the STAX service
SERVICE STAX LIBRARY JSTAF \ EXECUTE {STAF/Config/STAFRoot}/services/stax/STAX.jar \ PARMS "NUMTHREADS 30 MAXFILECACHESIZE 50 MAXRETURNFILESIZE 5m" \ OPTION J2=-Xmx2560m \ OPTION JVMName=STAFJVM

However, the STAX service fails to launch throwing an error in the JVM logs

JVMJ9VM015W Initialization error for library j9gc24(2): Failed to instantiate heap; 2560M requested

Reducing the memory allocated resolves the problem, but the issue is that it is not possible to allocate available memory to the STAX service thus we are not able to make best use of available resources.

******************************************************************************
*** 20120417-16:50:36 - Start of Log for JVMName: STAFJVM
*** JVM Executable: java
*** JVM Options : -Xmx2560m
*** JVM Version : java version "1.6.0"
Java(TM) SE Runtime Environment (build pxi3260sr9fp2-20110625_01(SR9 FP2))
IBM J9 VM (build 2.4, JRE 1.6.0 IBM J9 2.4 Linux x86-32 jvmxi3260sr9-20110624_85526 (JIT enabled, AOT enabled)
J9VM - 20110624_085526
JIT - r9_20101028_17488ifx17
GC - 20101027_AA)
JCL - 20110530_01
JVMJ9VM015W Initialization error for library j9gc24(2): Failed to instantiate heap; 2560M requested
Could not create the Java virtual machine.

Discussion

  • Sharon Lucas

    Sharon Lucas - 2012-05-22
    • assigned_to: nobody --> slucas
     
  • Sharon Lucas

    Sharon Lucas - 2012-05-22

    You are getting an error from Java that it cannot create the JVM because it "Failed to instantiate heap: 2560M requested". There's nothing that the STAX service itself can do about that. If you tried to start any Java application using that amount of heap, it would fail with the same error. The system does not have the necessary resources to satisfy the maximum default heap value.

    The "java -version" output in the JVM log indicates that the system is using a 32-bit JVM (Linux x86-32) and you said it is a Fedora Linux 32-bit system.

    You can google for information about Java heap size limitations when using a 32-bit JVM. For example, see question "Why can't I get a larger heap with the 32-bit JVM?" in the Java FAQ at http://www.oracle.com/technetwork/java/hotspotfaq-138619.html#gc_heap_32bit.

    As this FAQ entry says, "If your application requires a very large heap you should use a 64-bit VM on a version of the operating system that supports 64-bit applications".

    Some reasons behind the ~2GB limitation on Linux 32-bit systems are talked about at http://www.theserverside.com/discussions/thread.tss?thread_id=26347 (though it's a rather old thread).

    A more recent posting at http://www.coderanch.com/t/544285/java/java/Java-Heap-Size aays that "In Linux (e.g. RHEL 4.0 and later) you can run a hugepage kernel and JRockIt which gives a max 32-bit heap size of 2.7GB". Here's a link with some info on the JRockit JVM at http://javaeesupportpatterns.blogspot.com/2012/02/java-heap-space-jrockit-vm.html.

    So, I'm planning on closing this bug unless you have any other comments.

     
  • Sharon Lucas

    Sharon Lucas - 2012-05-24

    Added an entry to the STAF/STAX FAQ about the JVM's maximum heap size being limited to ~2G on most 32-bit operating systems.

    Here's a cvs diff of the change:

    Index: docs/faq/STAFFAQ.xml

    RCS file: /cvsroot/staf/src/staf/docs/faq/STAFFAQ.xml,v
    retrieving revision 1.82
    diff -r1.82 STAFFAQ.xml
    4607a4608,4665
    > <qandaentry>
    > <question>
    > <para>
    > Why is the STAX JVM's maximum heap size limited to ~2G on a 32-bit system?
    > </para>
    > </question>
    > <answer>
    > <para>
    > On a 32-bit system with lots of memory (e.g. 8G), if registering a STAF Java service
    > like STAX fails when specifying a maximum heap size of ~2G of more (e.g.
    > <command>OPTION J2=-Xmx2560m</command>) with an error like the following:
    > </para>
    > <programlisting>
    > JVMJ9VM015W Initialization error for library j9gc24(2): Failed to instantiate heap; 2560M requested
    > Could not create the Java virtual machine.
    > </programlisting>
    > <para>
    > you've probably run into a limitation using a 32-bit JVM because on most
    > operating systems running on a 32-bit architecture, processes (including the Java heap)
    > are limited to less than 2GB total memory.
    > </para>
    > <para>
    > For more information on Java heap size limitations when using a 32-bit JVM,
    > see question
    > <ulink url="http://www.oracle.com/technetwork/java/hotspotfaq-138619.html#gc_h
    eap_32bit">
    > Why can't I get a larger heap with the 32-bit JVM?</ulink> in the Oracle Java FAQ.
    > which says, "If your application requires a very large heap you
    > should use a 64-bit VM on a version of the operating system that supports
    > 64-bit applications".
    > Some reasons behind the ~2GB limitation on Linux 32-bit systems are talked
    > about in discussion thread
    > <ulink url="http://www.theserverside.com/discussions/thread.tss?thread_id=2634
    7">
    > How to avoid 2GB memory limit of JVM in Linux</ulink>.
    > Also see forum thread
    > <ulink url="http://www.coderanch.com/t/544285/java/java/Java-Heap-Size">Java Heap Size</ulink>
    > at the JavaRanch Java Forum which says:
    > </para>
    > <para>
    > "In most Operating Systems running on a 32-bit architecture, processes are limited to
    > less than 2GB total memory. This includes the Java heap, the process' heap and stack,
    > the memory used by JNI (if any), the thread stacks and other internal structures.
    > </para>
    > <para>
    > On a Sun Fire V440 w/ Solaris 9 and HotSpot JRE 5.0 the 32-bit heap limit is 4.3 GB.
    > </para>
    > <para>
    > In Linux (e.g. RHEL 4.0 and later) you can run a hugepage kernel and
    > JRockIt which gives a max 32-bit heap size of 2.7GB.
    > </para>
    > <para>
    > On MS Windows you can try something like /3GB or /PAE with JRockIt, but due to
    > the fact that the heap needs to be in consecutive memory, you'll end up with a heap
    > size of less than 2GB."
    > </para>
    > <para></para>
    > </answer>
    > </qandaentry>
    >

     
  • Sharon Lucas

    Sharon Lucas - 2012-05-24
    • status: open --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks