开发者

Getting more details on a specific memory leak

My memory leak looks like this:

Getting more details on a specific memory 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.

Getting more details on a specific memory leak


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜