This discussion is archived
6 Replies Latest reply: Feb 17, 2012 1:12 AM by 917338 RSS

JVM can´t allocate same heap mem after crash!

917338 Newbie
Currently Being Moderated
Hi!
I have a curios behavior of the JVM

HW info:
CPU: Intel i7
Mem: 4GB
OS: RedHat 5.5 32-bit
Kernel: 2.6.33

JRE: jre-1.6.0_30-fcs
(have try newer JRE with same behaviors)

On a clean new installed system I can start our java application with following commands/params
"java -Xms2048m -Xmx2048m -server cp bin/* com.nnn.nnnn.nnnn.ClientProgram"

After a while the application is crashed, (we are tracking that problem)

== Log info
2012-02-13 16:09:14,234 - appl_e1: #
2012-02-13 16:09:14,234 - appl_e1: # A fatal error has been detected by the Java Runtime Environment:
2012-02-13 16:09:14,234 - appl_e1: #
2012-02-13 16:09:14,235 - appl_e1: # SIGSEGV (0xb) at pc=0x1b30eafc, pid=5254, tid=459979664
2012-02-13 16:09:14,235 - appl_e1: #
2012-02-13 16:09:14,235 - appl_e1: # JRE version: 6.0_18-b07
2012-02-13 16:09:14,235 - appl_e1: # Java VM: Java HotSpot(TM) Server VM (16.0-b13 mixed mode linux-x86 )
2012-02-13 16:09:14,235 - appl_e1: # Problematic frame:
2012-02-13 16:09:14,235 - appl_e1: # C 0x1b30eafc
2012-02-13 16:09:14,235 - appl_e1: #
2012-02-13 16:09:14,236 - appl_e1: # An error report file with more information is saved as:
2012-02-13 16:09:14,236 - appl_e1: # /tmp/hs_err_pid5254.log
2012-02-13 16:09:14,243 - appl_e1: #
2012-02-13 16:09:14,243 - appl_e1: # If you would like to submit a bug report, please visit:
2012-02-13 16:09:14,243 - appl_e1: # http://java.sun.com/webapps/bugreport/crash.jsp
2012-02-13 16:09:14,244 - appl_e1: # The crash happened outside the Java Virtual Machine in native code.
2012-02-13 16:09:14,244 - appl_e1: # See problematic frame for where to report the bug.
2012-02-13 16:09:14,244 - appl_e1: #
===
(Unfortunately the log file is wioed out :-(( . Will post one when we get the crash )

Next time we try to start with same parameters the JVM can not allocate memory

==
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine
==

If we decrease the heap mem to 1536m we can start the application (JVM can allocate memory for the heap)


After rebooting the system we get same error with a heap of 2048m
It is possible to start it with a heap of 1536m


The most curios is if I reinstall the system I can allocate a heap of 2048m to the next crash !!!

Where is the information for the JVM about the heap mem allocation?
It must be somewhere on the file system?

//U
  • 1. Re: JVM can´t allocate same heap mem after crash!
    gimbal2 Guru
    Currently Being Moderated
    hm, you are also setting the minimum heap space to 2GB. I would set that to a lower value and let the JVM figure out how much it really needs. Try with with -Xms128m and see if the problem persists.
  • 2. Re: JVM can´t allocate same heap mem after crash!
    917338 Newbie
    Currently Being Moderated
    OKI

    We have try that to.....
    Same problem, same errors!!

    //U
  • 3. Re: JVM can´t allocate same heap mem after crash!
    gimbal2 Guru
    Currently Being Moderated
    Okay. Well so far I can draw two conclusions:

    1) You are experiencing some native crash, which is a crash that happens outside of Java code. These are very hard to track down and can be anything; a broken shared module, a driver, a bug in a native library of some API. Or a bug in the JVM of course.
    2) after the application crashes, the Java process is not killed off so it keeps hogging memory.

    Really, me personally I can't see any other way that would cause what you are experiencing. But perhaps someone with more experience in this area has an opinion on it.


    BTW: I see a major discrepancy in your original post.

    YOU CLAIM: JRE: jre-1.6.0_30-fcs
    IN FACT: 2012-02-13 16:09:14,235 - appl_e1: # JRE version: 6.0_18-b07
  • 4. Re: JVM can´t allocate same heap mem after crash!
    jschellSomeoneStoleMyAlias Expert
    Currently Being Moderated
    The most curios is if I reinstall the system I can allocate a heap of 2048m to the next crash !!!
    Presuming that you are not mis-reporting or mis-evaluating something...
    linux-x86
    On Linux virtual memory relies on file space that exists on the harddrive which is dedicated to that purpose.
    The file space is just like any other file space.

    If that file space fills up, for any reason, then the OS will appear to run out of memory for applications.

    The one time this happened to me the virtual space was mapped such that regular files were using the space. Specifically my log files. So as the log files grew the application memory decreased.
  • 5. Re: JVM can´t allocate same heap mem after crash!
    800381 Explorer
    Currently Being Moderated
    jschell wrote:
    The most curios is if I reinstall the system I can allocate a heap of 2048m to the next crash !!!
    Presuming that you are not mis-reporting or mis-evaluating something...
    linux-x86
    On Linux virtual memory relies on file space that exists on the harddrive which is dedicated to that purpose.
    The file space is just like any other file space.

    If that file space fills up, for any reason, then the OS will appear to run out of memory for applications.

    The one time this happened to me the virtual space was mapped such that regular files were using the space. Specifically my log files. So as the log files grew the application memory decreased.
    And if the crashed JVM generates a core file...
  • 6. Re: JVM can´t allocate same heap mem after crash!
    917338 Newbie
    Currently Being Moderated
    Hi All!
    Thanks for all suggestions

    I think we have found one part in this problem.

    As I describe we running following

    HW info:
    CPU: Intel i7
    Mem: 4GB
    OS: RedHat 5.5 32-bit (no PAE kernel)
    Kernel: 2.6.33


    It seams that the system install a function called "prelink" that is pre load libs to memory

    When I uninstall that package (prelink) we can allocate 2GB for java heap

    OK the program will probably start slower then with the prelink installed
    in our case it is not a problem.

    //U

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points