如何分析java应用程序的一部分的内存使用情况?

发布于 2024-10-23 22:23:32 字数 426 浏览 8 评论 0原文

我有一个 java 程序,可以模拟安全 RFID 系统的工作。它有2个主要类别。

1) 模仿 RFID 读取器的类和

2) 模仿 RFID 标签的类

我需要这些程序一起运行(在 2 个命令窗口中),并且我使用 JMS 在 2 个程序之间传递消息(如十六进制字符串和随机数)应用程序。

现在,由于RFID标签是一种资源限制,我想监控RFID标签上java程序的内存使用情况。我想针对不同算法和不同代码等变量记录内存使用情况,以找到最有效的解决方案。

所以,我的问题是:在进行此类比较分析时,使用的内存使用情况的最佳指标是什么?另外,我如何确定 JMS 的执行需要多少内存来来回发送消息,以便我可以从进程的总使用量中将其挑出来?

我目前正在使用VisualVM来查看内存如何随程序变化?有更好的程序可以用于此目的吗?

提前致谢!

I have a java program that simulates the working of a secure RFID system. It has 2 main classes.

1) A class that mimics a RFID Reader and

2) A class that mimics an RFID tag

I need these programs to run together (in 2 command windows) and I use JMS to pass messages (like hex strings and random numbers) between the 2 applications.

Now, since RFID tags are a resource constraint, I would like to monitor the memory usage of the java program on the RFID tag. I would like to record this memory usage against variables like different algorithms and different codes with the aim of finding the most efficient solution.

So, my question is: What would be the best indicator of memory usage to use when it comes to doing such a comparative analysis? Also, how could i determine exactly how much memory is going into the execution of JMS to send messages to and fro so that i can single it out from the total usage i get for the process?

I am currently using the VisualVM to see how the memory varies as the program? is there is better program to use for this purpose?

Thanks in advance!

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

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

发布评论

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

评论(2

_蜘蛛 2024-10-30 22:23:32

jprofiler ..需要许可证,但您可以在前 30 天试用。

jprofiler .. need license but you can try it for first 30 days.

一曲爱恨情仇 2024-10-30 22:23:32

您可以使用Eclipse Memory Analyzer工具。它是一个用于分析内存堆转储的 FOSS 工具 -

内存分析器 (MAT)
Eclipse Memory Analyzer 是一款快速且功能丰富的 Java 堆分析器,可帮助您查找内存泄漏并减少内存消耗。

使用内存分析器分析包含数亿个对象的高效堆转储,快速计算对象的保留大小,查看谁阻止垃圾收集器收集对象,运行报告以自动提取泄漏嫌疑人。

您可以在此处下载http://www.eclipse.org/mat/

You can use the Eclipse Memory Analyzer tool. It is a FOSS tool for analyzing your memory heap dump -

Memory Analyzer (MAT)
The Eclipse Memory Analyzer is a fast and feature-rich Java heap analyzer that helps you find memory leaks and reduce memory consumption.

Use the Memory Analyzer to analyze productive heap dumps with hundreds of millions of objects, quickly calculate the retained sizes of objects, see who is preventing the Garbage Collector from collecting objects, run a report to automatically extract leak suspects.

You can download it here http://www.eclipse.org/mat/

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