OQL syntax for counting string matching criteria

Please help me. I am analyzing my heap heaps in VisualVM.

How can I get the number of all rows with value == "0"? I have the following query:

select count(s) from java.lang.String s where s.toString().equals("0");

But that does not work. I want to get the number of all rows with a value of "0" and, if possible, their size in memory.

+4
source share
1 answer

This solved my problem.

select count(heap.objects('java.lang.String'), "it.toString().equals('0')")
+8
source

Source: https://habr.com/ru/post/1569962/


All Articles