如何在Java中剖析对象创建? [英] How to profile object creation in Java?
问题描述
如何追踪过多的临时对象的创建是值得欢迎的。
http://kenai.com/projects/btrace/pages/Homerel =nofollow noreferrer> http://kenai.com/projects/btrace/pages/Home ),或者使用 jvisualvm
在JDK 6u18中进行实时内存采样。 The system I work with is creating a whole lot of objects and garbage collecting them all the time which results in a very steeply jagged graph of heap consumption. I would like to know which objects are being generated to tune the code, but I can't figure out a way to dump the heap at the moment the garbage collection starts. When I tried to initiate dumpHeap via JConsole manually at random times, I always got results after GC finished its run, and didn't get any useful data.
Any notes on how to track down excessive temporary object creation are welcome.
Have a look at what BTrace can do (http://kenai.com/projects/btrace/pages/Home), alternatively try using jvisualvm
in JDK 6u18 which does live memory sampling.
这篇关于如何在Java中剖析对象创建?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!