Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OQL syntax for counting Strings matching criteria

Please help me. I analyse my heap dump in VisualVM.

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

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

But it doesnt work. I want to receive amount of all Strings with "0" value and if it's possible their size in memory.

like image 439
MeetJoeBlack Avatar asked Jan 05 '15 08:01

MeetJoeBlack


1 Answers

That's solved my problem

select count(heap.objects('java.lang.String'), "it.toString().equals('0')")
like image 66
MeetJoeBlack Avatar answered Sep 30 '22 12:09

MeetJoeBlack