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

前端 未结 2 830
挽巷
挽巷 2021-02-06 00:48

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 ex

2条回答
  •  感情败类
    2021-02-06 01:25

    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.

提交回复
热议问题