我已经将堆转储加载到map中。我找到了带有泄漏对象的哈希图。如何获取该哈希图中键的字段?我怀疑我在地图中有同一对象的多个副本,名称为 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
我想要每个键的显示名称字段。
请注意,MAT的OQL(http://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.mat.ui.help%2Freference%2Foqlsyntax.html)的规格与VisualVM不同。
SELECT OBJECTS keyNode.key FROM OBJECTS ( SELECT OBJECTS table[0:-1] FROM OBJECTS 41415459 ) keyNode
41415459是您的地图。如果您的键是对象并且您需要内部信息,则可以在此基础上进行进一步选择。如果数据量很大,并且需要进一步处理或获取统计信息等,则可以将数据导出为CSV。