Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serious memory leak using LineSeries #2025

Open
GuildOfCalamity opened this issue Aug 8, 2023 · 4 comments
Open

Serious memory leak using LineSeries #2025

GuildOfCalamity opened this issue Aug 8, 2023 · 4 comments
Labels
external The issue concerns or is caused by an external resource (e.g. a non-core UI platform or dependency)

Comments

@GuildOfCalamity
Copy link

Steps to reproduce

  1. Create WinUI3 desktop application.
  2. Install OxyPlot.WinUI 0.9.3
  3. Create <PlotView> and bind it to a PlotModel containing a LineSeries
  4. Run a timer that adds one DataPoint every second.

Platform:
.NET version: 6.0

Expected behaviour

No memory leak.

Actual behaviour

Huge memory leak. Was tested side-by-side using Microcharts, which displayed no memory leak.

image

@Jonarw
Copy link
Member

Jonarw commented Aug 9, 2023

Do you happen to have any more details about what exactly is leaking the memory? I'm not quite sure how LineSeries itself could leak, but who knows.
Could it also be something in OxyPlot.WinUI? Did you by any chance also test this with other UI Frameworks?

@VisualMelon
Copy link
Contributor

I'd suspect the WinUI provision in this case (had leaks in other provisions in the past): pinging @HavenDV because I think 0.9.30 must be one of his. Curve is disturbingly super-linear.

@GuildOfCalamity I'm not in a position to test it myself, but if you can provide a minimal reproducing example and if possible work out which objects are filling up all the memory via a profiler that would help with the investigation (e.g. snapshot from perf view)

@HavenDV
Copy link
Contributor

HavenDV commented Aug 10, 2023

HavenDV/H.OxyPlot#8

@GuildOfCalamity
Copy link
Author

GuildOfCalamity commented Aug 10, 2023

@Jonarw I haven't had a chance to run a profiler on this. Microcharts seemed to be a good fix for the issue. I will add that in the screen shot you will see a small dip at the very end, that was me clearing the graph object of all DataPoints and you can see that only a very small amount of memory was reclaimed by the GC. Running the same test using Microcharts showed a total memory commit of 159 MB which was to be expected (not 1.9 GB like the OxyPlot). Hopefully this can be addressed in the future because I would like to use OxyPlot.

@VisualMelon VisualMelon added the external The issue concerns or is caused by an external resource (e.g. a non-core UI platform or dependency) label Aug 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external The issue concerns or is caused by an external resource (e.g. a non-core UI platform or dependency)
Projects
None yet
Development

No branches or pull requests

4 participants