visualvm icon indicating copy to clipboard operation
visualvm copied to clipboard

Hide Memory Profiler results based on class in allocation stacktrace?

Open void256 opened this issue 5 years ago • 3 comments

I'm profiling memory and I'm not restricting classes in the Memory settings tab so that I can find allocations of all possible classes (Profile classes contains "*").

This works pretty good and I find f.i. "java.lang.Float" instances that I do actually create in my program (my classes are showing up in the allocation stack trace).

However, there are entries showing up that don't belong to any of my classes and which I suspect are maybe a side effect of the profiling itself, f.i javax.managment.openmbean.CompositeDataSupport or some java.io.ObjectOutputStream:

unwanted-allocation-stacktrace

Is there a way to somehow hide results like that? What is the origin of these allocations?

Thanks!

EDIT: If I don't limit the allocation stacktrace I can trace these back to some RMI/TCP connection that I suspect is maybe part of how jVisualVM gets its data from the process it profiles?

unlimited

void256 avatar Oct 10 '19 06:10 void256

CompositeDataSupport and ObjectOutputStream are used by JMX monitoring. This is used for example for CPU load and Thread state monitoring. JMX is not used for profiling.

thurka avatar Oct 10 '19 13:10 thurka

Thanks a lot for the clarification @thurka!

This was actually a very helpful hint because I can now add -Dsun.rmi.transport.tcp.maxConnectionThreads=0 to my application to force JMX monitoring off and all of the related entries are gone from the memory profile result tab 😄 This makes analyzing the output much more easy.

Well, having an option in VisualVM to turn JMX based monitoring off would make this a bit more accessible. Would this be possible?

void256 avatar Oct 12 '19 09:10 void256