如何访问内存池 mbean

发布于 2024-09-03 02:42:59 字数 185 浏览 4 评论 0原文

我想通过java程序访问MemoryPool Mbeans,以便检索一段时间内的Eden Space、Perm Gen space、CodeCahe、Survior Space统计信息。 如何做到这一点? 我尝试了 java.lang:type=MemoryPool,name=Eden Space

我不幸运

谢谢, 香卡

I want to access MemoryPool Mbeans through a java program so that I can 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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

魂ガ小子 2024-09-10 02:42:59

以下内容对我来说效果很好: 'java.lang:type=MemoryPool,name=PS Eden Space'

如果您通过 JConsole 连接到您的应用程序,您将能够看到可用的 MBean 以及您想要使用的 MBean 的确切 ObjectName 。

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.

污味仙女 2024-09-10 02:42:59

有办法做到这一点。使用 ManagementFactory.MEMORY_POOL_MXBEAN_DOMAIN_TYPE,* 定义对象名称,获取实例。这解决了我的问题。

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文