Question

My memory leak looks like this: leak

Having not that much experience with the Eclipse Memory Analyzer i wonder if it can answer those two questions:

  • What's the source code position where most of those instances were allocated?
  • What's the reason they were not garbage collected?
    1. Did they stop but are still referenced somewhere?
    2. Are they still executing or sleeping?

EDIT: Looks like sbridges was right and my threads just never die. However i'm not really sure of the reason since the stacktrace doesn't seem to contain any of my code. The way i use ExecutorService must be wrong somehow.

threads

Was it helpful?

Solution

Somewhere your code is creating threads, and those threads never die. Threads can't be garbage collected, since a thread is a gc root. The easiest way to debug this will be to start the app, wait until you have a large number of threads, then connect to the app with JConsole, and look at the stack traces of the threads. To see stack traces, click on the threads tab and click on a thread under live threads.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top