jmap has an option to control that controls should a dump contains unreachable objects:
-dump:[live,]format=b,file=<filename>
Dumps the Java heap in hprof binary format to filename. The live
suboption is optional. If specified, only the live objects in the heap are dumped. To browse the heap dump, you can use jhat
(Java Heap Analysis Tool) to read the generated file.
This indirectly tells that a heap dump could contain unreachable objects.
jcmd syntax is:
jcmd $PID GC.heap_dump -all -overwrite -gz $FILE.hprof.gz
The flag -all
adds dead objects, by default only live. Unlike for jhat
where all are by default.
Seems TLAB (Thread Local Allocation Buffers) has nothing to to with a heap dump, it is only a special per thread area for a young generation.