Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why Old generation objects clearing up by minor GC

I am using Java 11 and using G1GC. The application that I am working on is a big data application, and the weird thing that I am noticing is that I am monitoring the application for 24 hours, and there is no major GC. But the size of Old gen is going down again and again periodically, and coincidently it is happening when minor GC is taking a lot of time at the same minute.
I am not able to understand why spikes on minor GC are clearing out data from Old gen.

like image 603
ashish malgawa Avatar asked Oct 20 '25 14:10

ashish malgawa


1 Answers

The G1 GC also has the concept of a Mixed GC which gives G1 GC its name - Garbage First. In this GC, the young generation is cleaned as well as a number of regions from the Old space that contain the most garbage, that is, Garbage First. This mechanism allows the G1 GC to attempt to avoid the Full GCs for as long as possible. As the full GCs are mainly responsible for the long pause time associated with garbage collections, the G1 GC is able to minimize the need for these expensive operations.

like image 86
shaipraj Avatar answered Oct 23 '25 04:10

shaipraj



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!