yamcs / yamcs-studio

Desktop TM/TC Client for Yamcs
https://docs.yamcs.org/yamcs-studio/
Eclipse Public License 2.0
27 stars 14 forks source link

Yamcs Studio v1.0.5 memory leak, likely caused by xygraph widget #76

Closed tomvanbraeckel closed 5 years ago

tomvanbraeckel commented 5 years ago

We noticed that the memory usage of Yamcs Studio v1.0.5 is increasing by around 500MB/day and not being free'd when we have a big display called "ASIM MAIN.opi" opened.

Heap dumps pointed to draw2d.FigureCanvas as the potential root cause so we removed all 9 xygraph widgets from the display and indeed, the symptoms went away. Without the xygraph's, memory usage was stable, tested over a 24-hour run.

This issue should be easy to reproduce by making a display with some xygraph widgets, running it for some time with telemetry being graphed and monitoring the memory consumption of Yamcs Studio.

Note: one xygraph can be expected to leak 500MB/24 hours = only 2.31MB/hour so to reliably reproduce the issue, it might be necessary to use many xygraph widgets or to let the test run for a long time.

Perhaps a test display with 10 or even 100 xygraph widgets would be a nice stress test for Yamcs Studio, and it would demonstrate the issue by consuming more than 200MB of RAM per hour...

tomvanbraeckel commented 5 years ago

Long duration (11 days) test seems to indicate that the memory increase caused by the xygraph stabilizes after some time and after that, the increase is minimal. I will do further testing to confirm but for now it looks like this is a minor issue, or maybe even a non-issue.

tomvanbraeckel commented 5 years ago

Unable to demonstrate long-term memory increase using xygraph so this can be closed.