使用 JMX 计算应用程序的内存消耗

发布于 2024-09-26 15:12:33 字数 164 浏览 1 评论 0原文

我想编写一个内存监视和通知实用程序来监视 JVM 中的特定应用程序。需要明确的是,我对 JVM 内存消耗不感兴趣,而是想单独监视我的应用程序内存,并希望在内存超过特定级别时收到通知(通过电子邮件)。

我猜 MemoryMxBean 处理 JVM 内存。

任何想法将不胜感激。 谢谢。

I want to write a memory monitoring and notification utility that monitors specific application in JVM. To be clear I am not interested in JVM memory consumption rather I want to monitor my application memory alone, and want to get notified (by email) when ever the memory exceeds certain levels.

MemoryMxBean deals with JVM memory I guess.

Any thoughts would be appreciated.
Thanks.

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

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

发布评论

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

评论(1

娇纵 2024-10-03 15:12:33

看看 Sigar。它有一个基于 Java 的 API,用于收集有关本机操作系统内存使用情况以及各个进程的信息。创建一个使用 Sigar 公开此数据的 JMX MBean 将相当简单。

//尼古拉斯

Take a look at Sigar. It has a Java based API for gathering information about the native OS memory usage, as well as about individual processes. It will be fairly straight forward to create a JMX MBean that uses Sigar to expose this data.

//Nicholas

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