I'm using VisualVm to profile a Web Application running in Tomcat. Tomcat keeps crashing with out of memory errors so I'm trying to figure out what in my application is causing it.
When I run the memory profiler from VisualVm it looks like the majority of the memory is taken up by String/Char[] but I unless I can figure out the higher level containers of those strings that knowledge does me very little good. In doing research I've found OQL and rsizeof()
so I can for example SELECT rsizeof(o) FROM instanceof my.package.class o
but I don't know which class I need so I would really like to to be able to run something like SELECT it.name, rsizeof(o) FROM instanceof Filter(Heap.classes(), "/my.package./(it.name)");
instead but that doesn't work.
So what would be the OQL? Ideally I'd like to limit to the Top 10 or so biggest, and sort by size.