如何分析java应用程序的一部分的内存使用情况?
我有一个 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
jprofiler
..需要许可证,但您可以在前 30 天试用。jprofiler
.. need license but you can try it for first 30 days.您可以使用Eclipse Memory Analyzer工具。它是一个用于分析内存堆转储的 FOSS 工具 -
您可以在此处下载http://www.eclipse.org/mat/
You can use the Eclipse Memory Analyzer tool. It is a FOSS tool for analyzing your memory heap dump -
You can download it here http://www.eclipse.org/mat/