jmap is a utility tool that prints heap memory details of a java process. I found this very useful when I was having java.lang.OutOfMemoryError: PermGen space exceptions. I use this tool to monitor the PermGen memory over the time so that I could assign appropriate PermGen and that resolved my problem. When you get PermGen memory exception, its not memory leak, you just need to adjust PermGen memory size. Also One thing I found, if you are setting memory size through the command line, make sure you -XX: parameters at the beginning after java command else, I found the setting doesn't take effects and I discovered this using jmap command.
command to print process heap memory details:
jmap -heap pid
java app execution
java -XX:MaxPermSize=256MB -jar filename.jar
No comments:
Post a Comment