给定hashmap的对象id,获取hashmap中键的字段

时间:2017-01-25 21:14:00

标签: java memory-leaks eclipse-memory-analyzer oql

我已将堆转储加载到地图中。我找到了漏洞对象的hashmap。如何获取该hashmap中的键的字段?我怀疑我在地图中有相同对象的多个副本,其名称如joseph_0001,joseph_0002,...,joseph_WXYZ。

到目前为止,我已尝试过以下陈述。

/* 41415459 is the object id. This just gives me back the hashmap */
SELECT * FROM OBJECTS 41415459


/* this gives me the hashmap's internal table */
SELECT o.table FROM OBJECTS 41415459 o 

/* this also gives the that hashmap's internal table
   but displayed in a prettier way */
SELECT * FROM OBJECTS 122490835

/* this doesn't return anything. i understand it doesn't make
   and sense because we're asking for the key of an array which
   an array doesn't have but I hope conveys what i'm trying to
   achieve */
SELECT o.key.displayName FROM OBJECTS 122490835 o 

/*
Problem reported: 
Sub-Select must return an object list: SELECT o FROM OBJECTS 122490835 o 
*/
SELECT n.key from (SELECT o FROM OBJECTS 122490835 o) n 

我想要每个键的displayName字段。

请注意MAT的OQL(http://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.mat.ui.help%2Freference%2Foqlsyntax.html)的规范与VisualVM不同。

0 个答案:

没有答案