Obtaining a memory dump...

Discussion in 'Java' started by Mikhail T., May 11, 2007.

  1. Mikhail T.

    Mikhail T. Guest

    Hello!

    We know, that sending a Java process signal 3 will cause it to dump the
    list of threads to the stderr.

    What we would like, however, is the (huge) list of objects.

    A vendor's program (we don't have sources) runs for a while here
    consuming "modest" 80Mb of memory.

    Then -- SOMETHING -- happens, and the process' memory consumption starts
    to grow rapidly, until it reaches the maximum heap size (currently set
    to 3.2Gb) and reports "OutOfMemoryException". The process does not die,
    as the exception is caught (and the memory use returns to normal), but
    random things begin to fail and it needs to be restarted...

    We can not reproduce the problem reliably, so the vendor can't help us
    solve it much.

    What we'd like is to obtain the dump of all objects to get a hint on
    what is causing the out-of-control memory consumption.

    I'm aware of multiple different memory profilers, but they all seem to
    get the snapshots *upon request*. We can't sit here requesting snapshots
    periodically, and doing so will impose unwelcome extra load on the process.

    Is there some way, we can obtain a dump, when the exception is thrown?

    Alternatively, can we obtain the heap-dump the same way we can obtain
    the thread-dump?

    Thanks!

    -mi
     
    Mikhail T., May 11, 2007
    #1
    1. Advertising

  2. Mikhail T.

    Lew Guest

    Mikhail T. wrote:
    > Hello!
    >
    > We know, that sending a Java process signal 3 will cause it to dump the
    > list of threads to the stderr.
    >
    > What we would like, however, is the (huge) list of objects.
    >
    > A vendor's program (we don't have sources) runs for a while here
    > consuming "modest" 80Mb of memory.
    >
    > Then -- SOMETHING -- happens, and the process' memory consumption starts
    > to grow rapidly, until it reaches the maximum heap size (currently set
    > to 3.2Gb) and reports "OutOfMemoryException".


    Are you quite certain? I strongly suspect, but have to ask, isn't it actually
    an OutOfMemoryError?

    The thing is, with an Error you aren't supposed to let the process live:
    > An Error is a subclass of Throwable that indicates serious problems that a reasonable application should not try to catch.

    (<http://java.sun.com/javase/6/docs/api/java/lang/Error.html>)

    and yet,
    > The process does not die, as the exception is caught (and the memory use returns to normal), but
    > random things begin to fail and it needs to be restarted...


    Explaining, perhaps, why the language Designers told the us not to catch that
    Error. Tsk, tsk.

    Which would still leave you with the difficulty of diagnosing the problem.

    Aside from getting a complete JVM dump, is there anything spitting out in the
    error messages that gives any clue?

    --
    Lew
     
    Lew, May 12, 2007
    #2
    1. Advertising

  3. Mikhail T.

    ajX Guest

    ajX, Feb 21, 2013
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Microsoft News Server

    Getting proper Stack information from memory dump

    Microsoft News Server, Nov 9, 2004, in forum: ASP .Net
    Replies:
    9
    Views:
    1,293
    Jim Cheshire [MSFT]
    Nov 11, 2004
  2. halfdog
    Replies:
    12
    Views:
    12,551
  3. Otto Barnes

    Hashtable Memory Dump?

    Otto Barnes, Aug 4, 2003, in forum: C++
    Replies:
    1
    Views:
    407
    Mike Wahler
    Aug 4, 2003
  4. Chris Cranford

    Dump Memory Pointer?

    Chris Cranford, Apr 14, 2004, in forum: C++
    Replies:
    5
    Views:
    3,822
    Christopher Benson-Manica
    Apr 15, 2004
  5. Todd
    Replies:
    4
    Views:
    560
    Jeff Higgins
    Sep 5, 2007
Loading...

Share This Page