javauser9119
javauser9119

Reputation: 41

how to see objects in survivor space

Is there any way to see what objects are in survivor space. I have a situation where survivor from space is 100% used but the survivor ( to) space is 0% used. I have used some profiling tools but they don't provide utilization by the memory regions. Any help is greatly appreciated.

Upvotes: 4

Views: 755

Answers (2)

Alexey Ragozin
Alexey Ragozin

Reputation: 8399

One of survivor spaces will always be empty. That is fundamental property of GC algorithm used in HotSpot JVM.

HotSpot is using copy collector for young space (EDEN and survivors). On odd collections EDEN + S0 are copied to S1, on even collections EDEN + S1 are copied to S0. As a result EDEN and one of survivors becomes empty. EDEN is filled with new objects later, but survivor will remain empty until next young collections.

See also Understanding GC pauses in JVM, HotSpot's minor GC for more details.

Upvotes: 0

Eran Medan
Eran Medan

Reputation: 45775

jvisualvm should be your friend here, if it doesn't have this natively in your JDK, then something something like this plugin can help: https://blogs.oracle.com/klc/entry/visualgc_plugin_for_visualvm

Also try: http://www.oracle.com/technetwork/java/visualgc-136680.html

enter image description here

Upvotes: 1

Related Questions