Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Reasons for frequent Full GC

Shulou Source: shulou.com Published: 2022-06-03 04:12:03 11月13日 Update

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.

Tags: Information stack code comments threads positioning frequency method space reason probability performance screenshot manual state process focus reference development Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Apple Shulou Tech Info vpn MariaDB