开发者

Get visual graph of heap memory usage in Java over a span of time

I am currently using Visual VM to monitor the heap memory usage of my Java application. However I would like开发者_JAVA技巧 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?


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.


Try the Memory tab in JConsole. JConsole is also included with the Oracle JDK, like JVisualVM, so you should already have it. It has a time range of "all" which should work for what you want to do. It will look like this:

Get visual graph of heap memory usage in Java over a span of time

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜