NOTE

1.2 STW

Stop-the-world pauses suspend application threads during garbage collection. These notes examine the memory interactions between application and GC threads and the reasons for pausing.

Garbage Collection / RuntimeCreated Updated 1 min readhistorical

This is a historical learning note and may contain outdated or incomplete understanding.

1. What Is STW?

GC prevents the application from responding to external requests.

2. Why Does STW Happen?

In a language with GC, there are at least two threads: the user thread and the GC thread. The user thread creates objects and GC reclaims objects. If the two threads execute concurrently, objects that are not garbage may be reclaimed, so the user thread is paused during GC.

3. How to Solve STW

Discussion

Sign in with GitHub to comment. Discussions are stored as GitHub Issues.View on GitHub