Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

string search using OQL

I am using VisualVM to analyze a core dump. I suspect some XML objects to be causing the leak but there are way too many String objects to go through one by one.

Can I use OQL to search String that begin with 'GH' ?

thanks for any help.

like image 604
Geek Avatar asked Jul 17 '12 17:07

Geek


2 Answers

under JDK 1.8.20 a more simple variant works:

select s from java.lang.String s where s.toString().startsWith("GH")
like image 114
Yura Avatar answered Sep 22 '22 09:09

Yura


Try this: select {instance: s, content: s.toString()} from java.lang.String s where s.count>2 && s.toString().substring(0,2)=="GH"

like image 43
Tomas Hurka Avatar answered Sep 19 '22 09:09

Tomas Hurka