To answer my own question, I was trying to view the hprof file from Java/Debug
Perspective. When I switch to Memory Analysis
perspective, I could view the details of all objects, including key-value pairs for hashmap entries, in an Inspector
-> Attributes
window towards the left.
Edit: "key" attribute of the hashmap entries are still not visible. Only attributes of my custom hashmap entry object, which is the "value" part are visible. So, what I did is, for testing purpose, I put the key attribute (which is an integer), in the custom hashmap entry object, to be able to view it from the Inspector
-> Attributes
from the Memory Analysis
perspective.
class TextCache{
Bitmap bitmap;
int left;
int right;
int keyCode;
int key; // this is actually the key used to insert objects of TextCache into the hashmap.
}
If anybody finds out, how to directly view the "key" part from the hprof file, it would be great.