简体   繁体   中英

How do I get a peak memory usage snapshot from JVisualVM?

I need a memory snapshot at the peak of my application's memory usage - is there an easy way to achieve this?

thanks

Uh? Unless you can quantatively say when that peak occurs, how would you expect this to be implemented? If every single point in time could be the one state you want to save, and there's no way of knowing in advance, it would have to save a complete snapshot for all points. That sounds hard.

An alternative to JVisualVM would be to take your native_stderr.log and open it in IBM's Pattern Modeling and Analysis Tool for Java Garbage . You'd be able to quickly see the highest point at which your application is using heap space.

Monitor the application with VisualVM/JConsole. when you see the peak do a heap dump.

Another way would be (if you do not want to monitor) to reducte the Xmx to something you know for sure it is going to throw a Out of Memory Exception. And activate the flag -XX:+HeapDumpOnOutOfMemoryError

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM