JFreeChart堆空间 [英] JFreeChart heap space

查看:91
本文介绍了JFreeChart堆空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是想知道是否有一种方法可以阻止JFreeChart破坏堆,或者没有做那么多的选择. SpreadsheetDateMillisecondDay占用了约70 MB的堆空间,但是垃圾收集器也可能会受到破坏.他们是我应用程序中堆空间的最大用户.还有使用12 MB的TimeSeriesDataItem.这是针对所有图表每200毫秒左右记录一次的事情.

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.

我还将更新/存储仅在用户单击UI中的项目以显示它们时才立即使用的少量数据集.

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.

而且,在Visual VM中是否可能由于内存采样器表中的特定类名而显示出大量垃圾回收th动?

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

推荐答案

我想我用一个简单的解决方法解决了这个问题–现在,我在每个addOrUpdate操作之后调用timeSeries.removeAgedItems(false).很好,我的堆使用率下降了:)

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 :)

这篇关于JFreeChart堆空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆