view raw
RanPaul RanPaul - 11 months ago 60
Java Question

In a visualvm heap dump, what is the number after "Local Variable" for threads?

I am analyzing the threads in the heap dump using the

and am wondering whats the count after the
Local Variable: byte[]
in the below thread means? does it mean the size of the variable? or the total number of instances of the variable? or anything else?

"Multicast Heartbeat Receiver Thread" daemon prio=5 tid=38 RUNNABLE
at Method)
at<unknown string>)
Local Variable:
Local Variable:
at<unknown string>)
at<unknown string>)
at net.sf.ehcache.distribution.PayloadUtil.ungzip(
Local Variable:
Local Variable: byte[]#537427
Local Variable: byte[]#537474
Local Variable:
at net.sf.ehcache.distribution.MulticastKeepaliveHeartbeatReceiver$MulticastReceiverThread.processPayload(
Local Variable: org.glowroot.agent.model.TraceEntryImpl#12145
Local Variable: org.glowroot.agent.model.OptionalThreadContextImpl#7
at net.sf.ehcache.distribution.MulticastKeepaliveHeartbeatReceiver$
Local Variable: byte[]#4513


The number after the # is a sequence number. E.g. Local Variable: byte[]#537427 means that this is your 537427:th instance of byte[].

It becomes clear if you click the instances tab in visual vm. In the following picture I see a list of all my byte arrays in my test program, enumerated from #1 and onwards, where N items denotes the size of the array.

enter image description here