JFreeChart heap space

蓝咒 提交于 2019-12-24 00:39:51

问题


I'm just wondering if there's a way to stop JFreeChart thrashing the heap, or an alternative that doesn't do it so much. SpreadsheetDate, Millisecond and Day are taking up about 70 MB of the heap, but the garbage collector is probably getting thrashed too. They are, collectively, the biggest users of heap space in my app. There's also TimeSeriesDataItem which uses 12 MB. This is with recording things every 200 milliseconds or so, for all charts.

I'm also updating / storing a fair few datasets which aren't used immediately, only when the user clicks on the item in the UI to display them.

Also, is it possible in Visual VM to show much garbage collection thrashing is due to a particular class name in the memory sampler table?

Cheers,
Chris


回答1:


I think I solved this with a simple fix -- I now call timeSeries.removeAgedItems(false) after every addOrUpdate op. Works a treat, my heap usage is down :)



来源:https://stackoverflow.com/questions/6903049/jfreechart-heap-space

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