I am currently using Visual VM to monitor the heap memory usage of my Java application. However I would like to somehow see the heap memory usage over a span of time like for example a day and not just get a snapshot.I would like to be able to leave Visual VM or a tool on and let it log the memory usage and then later after one day, I can go back and see a graph of it. Is there a way to do this using Visual VM? If yes, how? If not, what tool can I used to do this?
The easy way to monitor Heap usage is by using a commercial APM (Application Performance management tool) such as CA Wily APM, AppDynamics, New Relic, Riverbed, etc. APM tools not only monitor the heap usage, but you can also configure the tool to Alert you when Heap usage is not normal.
Using VisualVM (jvisualvm) jvisualvm is a tool to analyse the runtime behavior of your Java application. It allows you to trace a running Java program and see its the memory and CPU consumption. You can also use it to create a memory heap dump to analyze the objects in the heap.
Eclipse Memory Analyzer Tool ( MAT ) is used for analyzing heap dump files which contain objects in memory. Each heap dump file can be thought of as a snapshot in time and details the memory occupied by specific JVM threads.
Run your Java program with the following Java options:
-Xloggc:log.out -XX:+PrintGCDetails -XX:+PrintGCTimeStamps
and download HPjmeter to visualize log.out
.
Also see SUN's GC portal webpage for more options to run with. Since the data is written to a file, you won't have any problems collecting days or weeks worth of data. Of course, if you wish to visualize data with lots of information, you'll need to run HPjmeter with more memory.
Your other option is to use JConsole.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With