Question

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.

Was it helpful?

Solution

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

OTHER TIPS

under JDK 1.8.20 a more simple variant works:

select s from java.lang.String s where s.toString().startsWith("GH")
heap.objects('java.lang.String', false, "it.toString().startsWith('GH')")

select c.attr_name.toString() from a.b.c.MyClass c where c.attr_name.toString().startsWith("GH")

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top