-
Notifications
You must be signed in to change notification settings - Fork 441
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
Fix garbage collection #2754
Merged
Merged
Fix garbage collection #2754
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
@@ Coverage Diff @@
## main #2754 +/- ##
==========================================
- Coverage 93.97% 93.94% -0.04%
==========================================
Files 76 76
Lines 16320 16348 +28
==========================================
+ Hits 15337 15358 +21
- Misses 983 990 +7 |
adeak
reviewed
Jun 11, 2022
Co-authored-by: Andras Deak <adeak@users.noreply.github.com>
adeak
reviewed
Jun 11, 2022
Co-authored-by: Andras Deak <adeak@users.noreply.github.com>
* Update information of translation project * Apply suggestions from code review * Apply suggestions from code review * Apply suggestions from code review * Update doc/index.rst Co-authored-by: Alex Kaszynski <akascap@gmail.com> Co-authored-by: Andras Deak <adeak@users.noreply.github.com>
Updates the requirements on [hypothesis](https://github.com/HypothesisWorks/hypothesis) to permit the latest version. - [Release notes](https://github.com/HypothesisWorks/hypothesis/releases) - [Commits](HypothesisWorks/hypothesis@hypothesis-ruby-0.0.1...hypothesis-python-6.47.1) --- updated-dependencies: - dependency-name: hypothesis dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: akaszynski <akaszynski@users.noreply.github.com>
* Add generate_polygon arg to Polygon * Apply suggestions from code review * Apply suggestions from code review Co-authored-by: Andras Deak <adeak@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Andras Deak <adeak@users.noreply.github.com>
* skip or avoid creating files in doc build * remove mention of _get_default_tempdir
* Create codeql-analysis.yml * Update README.rst * Update app.py * Fix by isort * Delete codeql-analysis.yml * Apply suggestions from code review
* Add extrude-trim.py * Add example comment * Add test * Add an inplace test * Add extrude_trim filter * Apply suggestions from code review * Apply suggestions from code review * Apply suggestions from code review * Update pyvista/core/filters/poly_data.py Co-authored-by: Phil Chiu <whophil@users.noreply.github.com> * Apply suggestions from code review * Fix by black * Fix by isort * Apply suggestions from code review * Apply suggestions from code review * Apply suggestions from code review * Apply suggestions from code review * Apply suggestions from code review * Apply suggestions from code review * Apply suggestions from code review * Apply suggestions from code review * Apply suggestions from code review Co-authored-by: MatthewFlamm <39341281+MatthewFlamm@users.noreply.github.com> * improve example Co-authored-by: Phil Chiu <whophil@users.noreply.github.com> Co-authored-by: MatthewFlamm <39341281+MatthewFlamm@users.noreply.github.com> Co-authored-by: Alex Kaszynski <akascap@gmail.com>
Updates the requirements on [hypothesis](https://github.com/HypothesisWorks/hypothesis) to permit the latest version. - [Release notes](https://github.com/HypothesisWorks/hypothesis/releases) - [Commits](HypothesisWorks/hypothesis@hypothesis-ruby-0.0.1...hypothesis-python-6.47.2) --- updated-dependencies: - dependency-name: hypothesis dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* optionally fail when image is missing * use in linux tests instead of windows * remove failing test
* fix return types * override __array_wrap__ * Apply suggestions from code review * Update pyvista/core/pyvista_ndarray.py Co-authored-by: Andras Deak <adeak@users.noreply.github.com> Co-authored-by: Andras Deak <adeak@users.noreply.github.com>
Ready for review @adeak. |
adeak
reviewed
Jun 14, 2022
adeak
reviewed
Jun 14, 2022
Co-authored-by: Andras Deak <adeak@users.noreply.github.com>
@adeak, we're ready for review (again). |
adeak
approved these changes
Jun 16, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving the earlier changes, but @akaszynski please check mine before merging (assuming CI ends up green).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
First Problem: Unnecessary Scalar Array Copying
As pointed out, we're copying scalars within
add_mesh
. When plotting existing scalars with:We actually create a copy of the scalars:
pyvista/pyvista/plotting/mapper.py
Lines 253 to 263 in 316a110
This is inefficient, but this actually protects us from underlying garbage collection issues.
Second Problem: Garbage Collection of VTK Arrays
When performing a shallow copy, we end up with a VTK array memory leak. This can be reproduced with:
This issue is caused by us recreating the pointer to the underlying VTK array, and the old pointer is not discarded. The solution to this is to simply reuse the underlying pointer.
Requires #2770
Bonus changes
set_scalars
use ofconfigure_scalars_mode
as we were calling that twice when setting scalars for custom opacity.