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

BUG: Fix ref cycle problem #894

Merged
merged 1 commit into from
Sep 23, 2020
Merged

BUG: Fix ref cycle problem #894

merged 1 commit into from
Sep 23, 2020

Conversation

larsoner
Copy link
Contributor

This code:

import gc
import time
import pyvista as pv
from pyvistaqt import BackgroundPlotter
from pyvista import examples
vol = examples.download_knee_full()

for _ in range(10):
    plotter = BackgroundPlotter()
    plotter.add_volume(vol)
    plotter.show()
    plotter.close()
    plotter.deep_clean()
gc.collect()
time.sleep(2)

Run with:

mprof run mem.py; mprof plot

Produces this on master:
Screenshot from 2020-09-18 07-49-28

And this on this PR:

Screenshot from 2020-09-18 07-49-51

Getting rid of volume was enough to fix it, but I figure getting rid of textactor is also a good idea.

@codecov
Copy link

codecov bot commented Sep 18, 2020

Codecov Report

❗ No coverage uploaded for pull request base (master@24ed44b). Click here to learn what that means.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##             master     #894   +/-   ##
=========================================
  Coverage          ?   86.90%           
=========================================
  Files             ?       36           
  Lines             ?     8983           
  Branches          ?        0           
=========================================
  Hits              ?     7807           
  Misses            ?     1176           
  Partials          ?        0           

Copy link
Member

@akaszynski akaszynski left a comment

Choose a reason for hiding this comment

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

Nice fix. Thanks for the memory plot for proof!

@akaszynski akaszynski merged commit 5462b37 into pyvista:master Sep 23, 2020
akaszynski pushed a commit that referenced this pull request Sep 23, 2020
@akaszynski akaszynski mentioned this pull request Sep 23, 2020
akaszynski added a commit that referenced this pull request Sep 24, 2020
* Fix renderer layers (#893)

* BUG: Fix ref cycle problem (#894)

* fixed edge case where scalar bar did not contain key (#899)

* bump version to 0.26.1

Co-authored-by: Guillaume Favelier <guillaume.favelier@gmail.com>
Co-authored-by: Eric Larson <larson.eric.d@gmail.com>
@akaszynski akaszynski mentioned this pull request Nov 8, 2020
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.

None yet

2 participants