Heap memory surplus, but crazy FullGc troubleshooting
A new application cluster has just been launched. On the second and third days, an alert message is sent to the application whose FullGc exceeds the threshold. However, the jvm monitoring of the alarm Java instance is observed. The heap memory usage is only 1 GB, with a surplus of nearly 700 mb. I am confused. If so much memory is not used, it means that the memory is sufficient in the old age!
Execute the jstat-gcutil command for the alert instance process to get the usage percentage of each generation of memory for the java Process.
It is found that the utilization rate of P is 98%, P, that is, Permanent Generation, Permanent Generation. That is to say, the permanent generation usage has exceeded 98%. The problem becomes clear. FullGc, it is easy to think of the memory explosion caused by the Old Generation! But this is not the only condition. permanent memory replacement is also managed by FullGc! Therefore, we strongly recommend that you add permanent monitoring on the monitoring page.
Then run the jstat-gccapacity pid command for this instance. It is found that the permanent generation of this instance is only 82 M. What does 82M mean? The default heap memory size for permanent generation.
Decisively Add the permanent JVM parameter-XX: PermSize = 512 M-XX: MaxPermSize = 512 M-XX: + HeapDumpOnOutOfMemoryError-XX: HeapDumpPath =/export/Logs/im. **. com /. Add the automatic dump parameter for memory OOM.