java heap analysis with oql: Count unique strings

前端 未结 6 1002
自闭症患者
自闭症患者 2020-12-29 09:11

Im doing a memory analysis of an existing java software. Is there a sql \'group by\' equivalent in oql to see the count of objects with same values but different instances.<

6条回答
  •  星月不相逢
    2020-12-29 09:35

    Method 1

    You can select all the strings and then use the terminal to aggregate them.

    1. Increase the oql limit in the visual vm config files
    2. restart visual vm
    3. oql to get all the strings
    4. copy and paste them into vim
    5. clean the data with vim macros so there's
    6. sort | uniq -c to get the counts.

    Method 2

    1. Use a tool to dump all the fields object the class you're interested in ( https://github.com/josephmate/DumpHprofFields can do it )
    2. Use bash to select the strings you're interested in
    3. Use bash to aggregate

提交回复
热议问题