JFreeChart heap space
Asked Answered
D

1

2

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

Denary answered 1/8, 2011 at 19:1 Comment(4)
are you tried to run your project with JProfiler, there you can see all Un-Closed ObjectsSelfmortification
Would DynamicTimeSeriesCollection, shown here, be an alternative? It profiles nicely at ~ 20 MB.Impound
@Selfmortification Will have a go with JProfiler, could be useful! I could have done with an academic license way back when..Denary
Indeed, not JProfiler though.Denary
D
3

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

Denary answered 2/8, 2011 at 0:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.