Skip to content

Fix Memory Leaks#51

Merged
pirmink merged 8 commits into
MeteoSwiss-APN:mainfrom
leuty:fix_leak
May 27, 2026
Merged

Fix Memory Leaks#51
pirmink merged 8 commits into
MeteoSwiss-APN:mainfrom
leuty:fix_leak

Conversation

@leuty

@leuty leuty commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

When running mover-plot I usually got a lot of the following warnings in plot.log:

RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`). Consider using `matplotlib.pyplot.close()`.

This PR aims at fixing the leaks related to these warnings by closing all the figures that are opened.

Testing:
(a) Warnings are gone for my usecase
(b) I checked with plt.get_fignums() at the end of station_scores.py, time_scores.py, daytime_scores.py and total_scores.py if any figures are left open.
(c) figures are bit identical
(d) wrote unit test that ensure that all figures are closed now

Review:
The PR is best reviewed file by file

@leuty leuty changed the title [WIP]: Fix Memory Leaks Fix Memory Leaks Apr 23, 2026
@leuty leuty requested a review from pirmink April 29, 2026 12:31
@pirmink pirmink requested a review from jansingl May 13, 2026 15:09

@pirmink pirmink left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E2e-test with operational verification results for spring 2026 was successful.

@pirmink pirmink removed the request for review from jansingl May 27, 2026 11:53
@pirmink pirmink merged commit f5591ed into MeteoSwiss-APN:main May 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants