Take heapdump on GC?

Alexey Ragozin alexey.ragozin at gmail.com
Tue Dec 24 12:33:40 PST 2013


Hi,

Take a look at https://github.com/aragozin/jvm-tools/blob/master/sjk-core/COMMANDS.md#hh-command

This tools could show you class histogram of garbage in heap
(internally it is using jmap).

Not a heapdump, but class histograms are still quite useable.

Another command which can help you
https://github.com/aragozin/jvm-tools/blob/master/sjk-core/COMMANDS.md#ttop-command

Besides CPU usage, it show allocation rate per thread, so you can
identify thread producing most garbage.

Regards,
Alexey

On Wed, Dec 25, 2013 at 12:00 AM,
<hotspot-gc-use-request at openjdk.java.net> wrote:

> Message: 4
> Date: Mon, 23 Dec 2013 22:03:53 -0800
> From: Guoqin Zheng <lanson.zheng at gmail.com>
> Subject: Re: Take heapdump on GC?
> To: Bernd Eckenfels <bernd-2013 at eckenfels.net>
> Cc: "hotspot-gc-use at openjdk.java.net"
>         <hotspot-gc-use at openjdk.java.net>
> Message-ID:
>         <CAD9+0v=ewVOvUzs+nZqrYiPnqH59kQ45q8q56Twf8Tc2DPPyEQ at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> 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
>>


More information about the hotspot-gc-use mailing list