开发者

How to access Memory pool mbeans

开发者 https://www.devze.com 2023-01-01 07:46 出处:网络
I want to access MemoryPool Mbeans through a java program so that I ca开发者_StackOverflow社区n retrieve the Eden Space, Perm Gen space, CodeCahe, Survior Space statistics during a period of time.

I want to access MemoryPool Mbeans through a java program so that I ca开发者_StackOverflow社区n retrieve the Eden Space, Perm Gen space, CodeCahe, Survior Space statistics during a period of time. How to do this? I tried java.lang:type=MemoryPool,name=Eden Space

I wan not lucky

Thanks, Shankar


The following worked fine for me: 'java.lang:type=MemoryPool,name=PS Eden Space'

If you connect to your app via JConsole you will be able to see the MBeans available and the exact ObjectName of the MBean you want to use.


Got the way to do it. Used ManagementFactory.MEMORY_POOL_MXBEAN_DOMAIN_TYPE,* for defining Object name, got the instances. That solved my problem.

0

精彩评论

暂无评论...
验证码 换一张
取 消