VisualVM profiling is polluting results

北城以北 提交于 2019-12-24 11:54:12

问题


I am using VisualVM memory profiling to analyse the memory allocation behavior of an application. Unfortunately, it seems the profiling process itself is polluting my results.

I continually see 80Mb being allocated over the timeframe of 5 minutes, which is due to memory profiling results being serialised over the JMXBean RMI connection. This memory is always in generation 1 and is immediately GC'd when I ask for it, but it is still annoying that this is showing up.

Can I filter memory profiling results based on the class that did the allocation?


回答1:


Try JProfiler, it does not use heap resources. You can see here:

Why does an empty Java program consume memory?

that visualvm even allocates lots of stuff when profiling an empty application.




回答2:


I have found the same problem. For this reason I use a commercial profiler, such as YourKit, which uses a native agent for its profiling and doesn't use the heap or have much overhead.



来源:https://stackoverflow.com/questions/8803383/visualvm-profiling-is-polluting-results

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!