Discovering Tenured Threshold programmatically
Krystal Mok
rednaxelafx at gmail.com
Thu Feb 2 18:58:12 PST 2012
Hi Philipp,
I'm not aware of any means of getting the current tenuring threshold via
JMX as of now.
But it's available through another API, namely the HSPERFDATA (or jvmstat)
API. If that doesn't sound familiar to you, the stats you see from jstat or
Visual GC actually come from this API.
Try this from command line:
jstat -J-Djstat.showUnsupported=true -snap <pid> | grep
'sun.gc.policy.tenuringThreshold'
This will give you the current tenuring threshold, and
jstat -J-Djstat.showUnsupported=true -snap <pid> | grep
'sun.gc.policy.maxTenuringThreshold'
this will give you the max tenuring threshold.
I've written an example of getting data from HSPERFDATA programmatically
some time ago [1]. The blog is in Chinese, but the code example should give
you enough hint. And there's another example of using the -snap parameter
with jstat [2].
Hope this helps,
- Kris
[1]: http://rednaxelafx.iteye.com/blog/790864
[2]: http://rednaxelafx.iteye.com/blog/796343
On Fri, Feb 3, 2012 at 3:55 AM, Philipp Stiegler
<gateway at gateways-home.org>wrote:
> Hello Guys,
>
> I tried to write my own monitoring tool to create dynamically views
> based on command line parameters.
> If someone needs the code for verification you find the source here:
> http://www.gateways-home.org/wb/media/jperfmon/jperfmon.zip
>
> My problem now is, that I also want to log the tenured threshold. I
> searched quite a while, but I didn´t find a way for getting this value
> from the jvm.
> Basically I connect to the vm via com.sun.tools.attach.VirtualMachine
> and I read the values out of the MBean structure (e.g. MemoryMXBean) but
> I don´t find this threshold in there.
> Maybe someone can help me out?
>
> Many thanks in advance!
>
> All the best!
>
> Philipp Stiegler
> _______________________________________________
> 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/20120203/7d112b21/attachment.html
More information about the hotspot-gc-use
mailing list