Take heapdump on GC?

Guoqin Zheng lanson.zheng at gmail.com
Mon Dec 23 22:03:53 PST 2013


Thank you, Bernd!

Since I have 1G space for young gen, but it still fills up quickly. That is
why I want to take a heap dump.

Anyway, I will try the second option you mentioned.



On Mon, Dec 23, 2013 at 2:04 PM, Bernd Eckenfels
<bernd-2013 at eckenfels.net>wrote:

> Am 23.12.2013, 09:31 Uhr, schrieb Guoqin Zheng <lanson.zheng at gmail.com>:
>
> > I have an application that fills up young gen in seconds. I want to take
> > a
> > heap dump on young gen collection, so that I can see what eats up the
> > young
> > gen so fast. How can I take such dump just before GC?
>
> Filling up YoungGen in seconds is not that unusual (especially when the YG
> is too small). If you want to catch the app in the act I guess it is the
> best to do it programmatically by waiting a specified time after the last
> YGC happened. The last YGC can be determined from JMX as well as
> triggering the heapdump. I dont think there is a hook which can be called
> before the YGC starts.
>
> Poll the following tabular data entry to see the time od the last YGC:
>
> java.lang:type=GarbageCollector,name=PS Scavenge # LastGcInfo # endTime
>
> Schedule a thread to trigger in x seconds afterwards with:
>
> com.sun.management:type=HotSpotDiagnostic # dumpHeap(filename, false);
>
> On the other hand, it might be easier to simply take a vew heap
> historgrams every second or something.
>
> Greetings
> Bernd
> --
> http://bernd.eckenfels.net
> _______________________________________________
> hotspot-gc-use mailing list
> hotspot-gc-use at openjdk.java.net
> http://mail.openjdk.java.net/mailman/listinfo/hotspot-gc-use
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-gc-use/attachments/20131223/4b33b99c/attachment.html 


More information about the hotspot-gc-use mailing list