Last Updated: February 1, 2026
Thread leakage occurs when threads are created but never properly terminated. These threads consume resources, primarily memory for their stack, as well as OS-level resources like file descriptors and kernel data structures, without doing any useful work.
Unlike a memory leak where objects are retained unintentionally, thread leakage involves active threads that the application has lost control over. They're not garbage collected because they're still running, even if they're stuck or forgotten.
Every thread in a typical application consumes:
| Resource | Typical Amount |
|---|---|
| Stack memory | 512KB - 1MB per thread (configurable) |
| OS thread handle | ~8KB kernel memory |
| Thread-local storage | Varies by application |
| JVM/runtime overhead | ~2KB metadata |
A few hundred leaked threads might go unnoticed. A few thousand will cause problems. Tens of thousands will crash your application.