开发者

Objects with "no references" in hprof

I'm investigating an hprof file in VisualVM

The server is running JDK 1.4.2_30 and has 1 GB heap with NewSize of 200 Mb.

The hprof shows 71% of the heap occupied by 56000 instances of int[] and none of these 56K arrays have references when view开发者_JAVA百科ed in VisualVM

As per us, this should have been garbage collected if there were "no references". So the questions are:

a) is there any way to find out these references?

b) Is this an incorrect snapshot - i.e. did the action of taking the heap dump do some sort of GC ?

c) Should we be looking at the "retained sizes" objects in VisualVM?

As an update - we still dont know what these int[] are, but the next largest objects were Weblogic internal EJB references in Pool, and we discovered an incorrect setting in one of those which has brought down memory util to 30% from earlier frequent Full GCs


Disclaimer: guesswork ahead, I don't have a clear answer, but I might be able to give some useful hints.

I've seen a similar situation lately ('though with a much more current Java version).

The reason for the big number of unreferenced int[] seems to have been mapped buffers of some kind (I'm not a NIO expert, but it seems to have been related to this).

The reason for this conclusion is that there was a very similar number of byte[] around with pretty much the same size in memory and those byte[] were referenced by some *Channel instances.

So my guess is (was) that those int[] are actually synthetic instances that actually share their memory with the byte[] (which are properly referenced). In short: they are red herrings.

All of this is a lot of guesswork and I never followed up with it, because the actual problem at that time turned out to be something entirely unrelated.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜