what is GC Suspension Time or GC Pause Time?


Garbage Collection:

When a Java application is running, it is creating new objects, but after a certain time, those objects will not be used, which will be considered as "garbage". Eventually, we'll start getting a lot of garbage, and memory will be used for objects which aren't being used anymore. If this keeps going on, at one point the Java Virtual Machine will run out of space to make new objects, leading to heap memory issues.
That's where the garbage collector steps in.
The garbage collector will look for objects which aren't being used anymore, and gets rid of them, freeing up the heap memory so other new objects can use that piece of memory. It is a form of automatic memory management.

Stop-the-world:
Stop-the-world will occur no matter which GC algorithm you choose. Stop-the-world means that the JVM is stopping the application from running to execute a GC. When stop-the-world occurs, every thread (including application threads) except for the threads needed for the GC will stop their tasks. The interrupted tasks will resume only after the GC task has completed.
The time for which the stop the world event occurs is called as the GC Suspension time or GC Pause time which has a direct impact on response time and throughput. GC tuning often means reducing this stop-the-world time.
The lesser the GC Suspension time better the response time and throughput of the application.


13 comments: