Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does a Java heap dump include thread stacks

Tags:

java

I have been using Eclipse Memory Analysis tool to examine a heap dump. I have not seen any cases where an object was kept alive by a local variable in a thread stack.

Are java thread stacks preserved in heap dumps? If not, do these objects get counted as unreachable objects in the dump? If so, is there any way to preserve the thread stacks so that uncollected garbage can be distinguished from local variable values?

like image 379
mchr Avatar asked Sep 08 '10 16:09

mchr


1 Answers

Yes

Heap dumps from more recent JVM's (as of 2010) included Thread Stacks. Eclipse Memory Analyzer 0.8 (released in January 2010) included support for extracting this information: http://www.eclipse.org/mat/0.8/noteworthy.html

like image 76
mchr Avatar answered Sep 18 '22 14:09

mchr