0

Im analyzing a heap dump using memory analyzer tool .From the dominator tree I've selected the class with highest retained memory (around 47%). Selected objects with out going reference and i see there is a hash map entry with more than 1GB of retained memory. I see the key and value pair like this

Class Name                                              | Shallow Heap | Retained Heap
---------------------------------------------------------------------------------------
key java.lang.String @ 0x717278cd8  MapAllProfilesOutput|           32 |            88
---------------------------------------------------------------------------------------

Class Name                                                   | Shallow Heap | Retained Heap
------------------------------------------------------------------------------------------------
value com.tibco.xml.xdata.xpath.Variable @                   |           24 | 1,194,483,312
|- <class> class com.tibco.xml.xdata.xpath.Variable          |           16 |         2,296
|- mValue com.tibco.xml.datamodel.nodes.Document             |           48 | 1,194,483,288
------------------------------------------------------------------------------------------------

Is there a way I can get the contents of the value ? I was reading some where about hashing using OQL so wanted to check the possibility. Also my heap dump is around 4.5 GB.

Vikdor
  • 23,934
  • 10
  • 61
  • 84
greenH0rn
  • 65
  • 2
  • 9
  • Do the contents particularly matter? It looks to be fairly straightforward. You're retaining some XPath-related variable that ends up retaining the entire in-memory document. Figure out how to store just the data you care about in that map. – Thorn G Oct 18 '13 at 20:37
  • I know that its an xpath variable but i wanted to know what are the values so I can analyze what values are not needed to be stored – greenH0rn Oct 18 '13 at 20:42

1 Answers1

0

I would suggest that you look at using the Eclipse Memory Analyzer. This gives you a graphical overview where you can easily drill down into the map in question. That said, if it is really 1.2GB in size… that is a lot of drilling down!

If you really want to use OQL, then the online help is a good resource. Using OQL, if the value that you select returns a string, it will be printed, for example:

select file.path.toString() from java.io.File file

will print the path of all File objects in your dump. You could use this to print out the salient details of your document, which will help to narrow down which documents you are dealing with.

Paul Wagland
  • 27,756
  • 10
  • 52
  • 74
  • if you haven't noticed I've mentioned in the question that am using eclipse memory analyzer tool.This is what I've done Dominator tree --> select outgoing references and from there couple levels of drill down and am at the point where I see the key value pair. Just like to see the data in Value. I'm not sure if I need to drill down any further – greenH0rn Oct 19 '13 at 02:41
  • @greenH0rn Actually, I did miss your reference to MAT, however then the second part of my answer should still be useful for you? – Paul Wagland Oct 20 '13 at 13:24
  • Yes I guess it would be useful. I haven't tried but will do and comment – greenH0rn Oct 20 '13 at 15:02
  • @greenH0rn were you able to figure out how to see the data of "Value" of some key-value pairs ? – Jeet Banerjee Oct 11 '21 at 15:28