Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Obtaining a memory dump...

Reply
Thread Tools

Obtaining a memory dump...

 
 
Mikhail T.
Guest
Posts: n/a
 
      05-11-2007
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
 
Reply With Quote
 
 
 
 
Lew
Guest
Posts: n/a
 
      05-11-2007
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
 
Reply With Quote
 
 
 
 
ajX
Guest
Posts: n/a
 
      02-21-2013
Here is a shell script to take and save thread dump in a text file. I have written a shell script to take the thread dump automatically.

visit : http://www.technotechi.com/2012/12/s...read-dump.html

It might help you.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Obtaining IP address of all devices on network Jerry West Wireless Networking 4 05-22-2011 12:18 PM
Obtaining IP Address via DHCP Eric Logsdon Wireless Networking 0 10-25-2005 03:05 PM
Differences between Sony Memory Stick & memory Stick Pro vs Memory Stick Duo? zxcvar Digital Photography 3 11-28-2004 10:48 PM
obtaining lengths of slices Griff Perl 6 08-06-2004 09:26 AM
Obtaining Server Uptimes using Perl Aaron Perl 0 06-14-2004 03:25 PM



Advertisments