NOTE

1.3 Memory Leak

Historical notes on memory leaks, why GC cannot reclaim memory still referenced by root objects, and several common causes.

Garbage Collection / RuntimeCreated Updated 1 min readhistorical

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

1. What Is a Memory Leak?

Memory keeps growing and cannot be reclaimed, eventually causing OOM. This is a memory leak, and it eventually causes OOM.

2. Why Do Memory Leaks Happen?

GC cannot reclaim memory referenced by Root objects.

3. How to Solve Memory Leaks

The key is to find Root objects that have not been released.

3.1. Resources Are Not Released

3.2. Too Many Resources Such as Threads Are Created

3.3. Memory Not Managed by GC

Discussion

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