Reading garbage collection activity logs
?? Saral Saxena ??????
?11K+ Followers | Linkedin Top Voice || Associate Director || 15+ Years in Java, Microservices, Kafka, Spring Boot, Cloud Technologies (AWS, GCP) | Agile , K8s ,DevOps & CI/CD Expert
When we executed the MemoryIssues application with -verbose:gc
[GC 163972K->163916K(237748K), 0.1814933 secs]
[Full GC 229516K->214339K(237748K), 0.8321936 secs]
Let's explore the different sections in these log statements by defining the general log structure, as follows:
Occupied space before -> occupied space after (total committed space size), time taken in space activity The first line is for a minor garbage collection activity (that is, young generation only)and the second line is for a full garbage collection activity (that is, including the old generation as well). The following diagram describes how to read these details:
We can get more information printed on the console by using the additional JVM parameter -XX:+PrintGCDetails.