Garbage Collection low-impact monitoring
the.6th.month at gmail.com
the.6th.month at gmail.com
Sun Mar 17 20:45:16 PDT 2013
Hi, Ruben:
In my prod environment, I am monitoring gc related metrics as this, I just
paste some snippet here and leave out the trivial :
List<GarbageCollectorMXBean> gcBeans = ManagementFactory
.getGarbageCollectorMXBeans();
for (GarbageCollectorMXBean bean : gcBeans) {
name = makeName((new StringBuilder(JVM_PREFIX)).append(
*bean.getName()*).toString()); //makeName is just a convenient method to
generate a metrics name following our convention
*final long count = bean.getCollectionCount(); //accumulated gc count for
this type of gc indicated by bean.getName since the process starting-up*
* final long time = bean.getCollectionTime(); //accumulated gc time **for
this type of gc indicated by bean.getName since the process starting-up*
* ..................*
}
and then you can make a one-minute interval timer to compute how many times
any type of gc happens in one minute, and draw a graph with cacti or
something.
All the best,
Leon
On 18 March 2013 09:59, Bernd Eckenfels <bernd.eckenfels at googlemail.com>wrote:
> Am 18.03.2013, 02:54 Uhr, schrieb Ruben Badaró <ruben.badaro at gmail.com>:
>
> > An easy way is to parse gc logs but I remember someone reading the VM
> > structs for the garbage collection counters somewhere.
>
> There is a JMX bean, but I think it is not detailed enough. I think the GC
> log is the most open one. I am not sure about those trace/flightrecorder
> stuff. It seems not to be openly available.
>
> Greetings
> Bernd
> _______________________________________________
> 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/20130318/c1153201/attachment.html
More information about the hotspot-gc-use
mailing list