如何获取 JConsole 中显示的 VM 信息?

发布于 2024-10-17 10:55:39 字数 421 浏览 12 评论 0原文

启动JConsole,选择一个进程,然后进入VM Summary,可以看到很多VM信息,例如:

  • 活动线程数
  • 当前加载的类数
  • 编译时间
  • 当前堆大小
  • 启动的线程总数

我可以在 Java 应用程序中访问该信息吗?如果是这样,怎么办?

更新: 这是一个图像 http://download.oracle .com/javase/1.5.0/docs/guide/management/images/summarytab.jpg

Starting JConsole, selecing a process and then and heading over to VM Summary, one can see a lot of VM information, such as:

  • Number of live threads
  • Number of current classes loaded
  • Compilation time
  • Current heap size
  • Total threads started

Is there I can access that information inside a Java application? If so, how?

Update:
Here is an image http://download.oracle.com/javase/1.5.0/docs/guide/management/images/summarytab.jpg

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

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

发布评论

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

评论(2

黄昏下泛黄的笔记 2024-10-24 10:55:39

这个野兽的名字是“Java管理扩展(JMX)”。

以下是 Oracle 的“入门”概述。您必须实现 JMX 管理器来从 JVM 或其他检测的应用程序读取已发布的内部结构。

The name of the beast is "Java Management Extension (JMX)".

Here is a "Getting Started" overview from oracle. You'll have to implement a JMX Manager to read the published internals from the JVM or from other instrumented applications.

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