Pregunta

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.

¿Fue útil?

Solución

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

Otros consejos

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")

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top