开发者

How to profile the memory usage for a part of a java application?

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 usag开发者_运维技巧e 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!


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


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/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜