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

Memory optimise #21

Merged
merged 8 commits into from
Aug 10, 2023
Merged

Memory optimise #21

merged 8 commits into from
Aug 10, 2023

Conversation

SmCTwelve
Copy link
Owner

Addresses the biggest blocks of memory not being freed up after command execution and plot figures lingering with additional blocks being allocated over time.

  • Replace pyplot.subplots interface with Figure instances
  • Replace plt.tight_layout with layout="constrained" parameter
  • Force clear any lingering plots with plt.close() when saving
  • Delete large intermediate dataframes where they are no longer needed
  • Force gc.collect() after command completion

Memory usage now only spikes during data processing but gets freed up after execution.

`plt.subplots` and `plt.tight_layout` were accumulating memory not being released by gc. Using Figure directly and force closing the figures on save showed memory returning to normal.
@SmCTwelve SmCTwelve linked an issue Aug 9, 2023 that may be closed by this pull request
@SmCTwelve SmCTwelve mentioned this pull request Aug 9, 2023
@SmCTwelve SmCTwelve merged commit e54602b into main Aug 10, 2023
@SmCTwelve SmCTwelve deleted the memory-optimise branch August 10, 2023 00:25
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.

Memory optimisations
1 participant