I need a memory snapshot at the peak of my application's memory usage - is there an easy way to achieve this?
thanks
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