Sobes.tech
Senior

Is there a Stop the World event during Garbage Collection in Java?

sobes.tech AI

Answer from AI

Yes, in Go during the garbage collector (GC) operation, there is a Stop the World (STW) phase when all goroutines are paused. However, starting from Go 1.5, the GC became concurrent and minimizes STW time, making pauses very short (usually in microseconds). This is achieved through parallel scanning and marking of objects, and STW is only used for short operations, such as phase switching of the GC.

Thus, although STW exists, its impact on performance is minimal and usually not noticeable in applications with properly tuned GC.