Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Memory Analyzer » Unable to figure out HashMap values - (use of Hash Entries context menu)(Struggling to understand and use the Hash Entries)
Unable to figure out HashMap values - (use of Hash Entries context menu) [message #665554] Fri, 15 April 2011 05:08 Go to next message
Missing name Missing name is currently offline Missing name Missing nameFriend
Messages: 2
Registered: April 2011
Location: Pittsburgh
Junior Member
Hi - I am new to Eclipse forums and the MAT plugin.

I am trying to review the contents of a HashMap which is an instance attribute of a certain class. I got to the point of writing the correct OQL query to view the list of java.util.HashMap.

select _attributes from com.sample.AClassWithHashMapVariable

So far so good. As I couldnt figure out a way to get to a particular key through the query, i thought the next best thing would be to use the Hash Entries menu.

But I am unable to view the contents of this hashmap using the Java Collections --> Hash Entries context menu. Actually, I am finding the Hash Entries slightly unintuitive. I just want to do something like this.

select _attributes.get("key") from com.sample.AClassWithHashMapVariable

I toyed with it for a couple of hours, tried setting the key value to the "-key_attribute" parameter, but nothing comes of it. The documentation talks about "custom (eg. non-jdk) map class" for all the attributes which I am unable to understand.

Sorry if this is a repetitive question, but i searched in this and the previous forums but did not find the answer to this. In fact one fine gentleman had suggested the use of Hash Entries for a similar question, but the original poster did not respond as to whether it worked out for him or not.

Any help would be greatly appreciated.


[Updated on: Fri, 15 April 2011 05:14]

Report message to a moderator

Re: Unable to figure out HashMap values - (use of Hash Entries context menu) [message #665642 is a reply to message #665554] Fri, 15 April 2011 11:04 Go to previous message
Andrew Johnson is currently offline Andrew JohnsonFriend
Messages: 164
Registered: July 2009
Senior Member
With the sample dump then this works for extracting objects which you can then run the Hash Entries query on:

SELECT objects lmap FROM sun.misc.URLClassPath$JarLoader

or for your example

select objects _attributes from com.sample.AClassWithHashMapVariable

Without the 'objects' keyword then each line is the object retrieved from by the select, and each column are the items specified in the select clause, which is just the _attributes field in your example.
The context menu operates on the object representing the entire row, which was the com.sample.AClassWithHashMapVariable object, which won't work with the hash entries query.
Previous Topic:How to analyse retained heap
Next Topic:Cannot find HashSet in Main Thread
Goto Forum:

Current Time: Wed Sep 30 23:19:07 GMT 2020

Powered by FUDForum. Page generated in 0.01804 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top