Menu

Java Memory Leak Heap Dump with Eclipse MAT: A Workflow
πŸ“°

Java Memory Leak Heap Dump with Eclipse MAT: A Workflow

DEV Community: javaΒ·Nora WhitfieldΒ·about 8 hours ago
#n1LCxh6r
#devtojava#devto#dev#heap#dump
Long article (2517 words) β€” no AI summary yet.
Reading 0:00
15s threshold

A rising old-generation line is not proof of a memory leak. It might mean the heap is too small, or that traffic grew, or that a full collection has not run yet. This tutorial works through a Java memory leak heap dump investigation on a small notification service whose heap climbs until it throws OutOfMemoryError : confirm the leak from GC logs, capture a live heap dump with jcmd , use Eclipse Memory Analyzer (MAT) to find the retaining reference, then fix it and prove the post-collection floor is flat.

The commands target JDK 21 and later, where jcmd and unified logging are the supported tools. The sample service keeps a static response cache and runs on a four-thread executor.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.