0

I'm trying to analyze a heap dump to determine if my hibernate cache settings are the cause.

Many instances of the object in question are referred to by "org.hibernate.internal.util.collections.IdentityMap". How can I construct an OQL query to return me the exact number of instances of my object that are referred to by hibernate?

tdimmig
  • 680
  • 9
  • 24

1 Answers1

0

If you are lucky, you may be able to get dominatorof() function to work, try something like this:

SELECT * FROM ".*" o WHERE classof(dominatorof(o)).@displayName.contains("class org.hibernate.internal.util.collections.IdentityMap")

But this will make MAT go through every object in the heap, so it will take a long time to return results (assuming you have a reasonably large heap). However the real problem is that I find the dominatorof() function to be inconsistent, so you may not find every object. If you have a list of classes, then you may be able to speed up the query and also confirm that you are getting the right dominators. E.g., if X and Y are the class names, you can use "X|Y" as the regex instead of ".*" and also run this query to see what you get:

SELECT dominatorof(o) FROM "X|Y" o
haridsv
  • 9,065
  • 4
  • 62
  • 65