Reasons for frequent Full GC
Trigger Full GC. Please refer to https://blog.51cto.com/11009785/2399498
Reasons for frequent Full GC:
1. The space of the older generation is relatively small.
Solution: first, increase the space of the older generation. Second: use CMS GC to recycle the older generation to reduce the probability of full gc.
two。 System.gc () was called
Solution:-XX:+DisableExplicitGC ignores the manual call to GC, and the call to System.gc () becomes an air conditioner without triggering GC at all.
Note:
How do you locate the code that calls System.gc ()?
If the frequent Full GC,jstack thread stack is caused by System.gc (), you should see some information.
Jstack: view thread stack information within a Java process
Jstack can navigate to the thread stack, and we can navigate to specific code based on stack information, so it is used a lot in JVM performance tuning.
Note 1: in the information displayed, focus on the code written by yourself, and take screenshots for the developer.
Note 2: it is possible that jstack cannot capture the required information at one time, so it needs to be executed multiple times, because it captures the state of that moment.