开发者

Is it possible to know at runtime when Garbage collection is occuring?

开发者 https://www.devze.com 2023-03-19 05:34 出处:网络
Basically, I am using achartengine for a charting application. It seems like i have a memory leak somewhere so garbage collection is occuring somewhat often. The problem is, whenever GC occurs, it mes

Basically, I am using achartengine for a charting application. It seems like i have a memory leak somewhere so garbage collection is occuring somewhat often. The problem is, whenever GC occurs, it messes up my chart. I can call repaint() to fix it, but I would need to know when GC.

Image of the messed up char开发者_高级运维t below

[URL=http://img166.imagevenue.com/img.php?image=403999439_device_2011_07_11_122608_122_441lo.png][IMG]http://img166.imagevenue.com/loc441/th_403999439_device_2011_07_11_122608_122_441lo.png[/IMG][/URL]


Each Java Object have a method finalize() which is called just before the GC try to "delete" the object. example

Hope this help.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号