Quantcast
Channel: OxyPlot (moved to GitHub)
Viewing all articles
Browse latest Browse all 2061

Commented Unassigned: Memory Leak in LineSeries [10151]

$
0
0
As described in this discussion:
https://oxyplot.codeplex.com/discussions/532576#post1215810

When LineSeries is bound to rapidly changing data, it can be observed that stale data which is no longer displayed is not being properly garbage collected. This leak is independent of the storage class that is used in the view model layer; the one test case that avoided the memory leak was by binding the line series to an observable collection, and clearing the observable collection prior to each update, however this process is expected to be extremely inefficient.

The attached project is equivalent to the usage within my application, and exhibits the leak. Eventually, the application should throw an OutOfMemoryException (typically within a few hours), although the leak can be observed rather quickly from a memory profiler.
Comments: I think there are some issues in your code: - You use multi-threading without locking `plotmodel.SyncRoot` - you use `CompositionTarget.Rendering` for invalidation (might lead to bad performance) As it is very hard for me to read VB code, I'm not sure if I understand everything what you are doing. But for sure you use OxyPlot in a bad way concerning multi-threading. Please check the WPF RealtimeDemo for how to use OxyPlot multiple threads and invalidation without CompositionTarget.Rendering to get reasonable performance.

Viewing all articles
Browse latest Browse all 2061

Trending Articles