-
Notifications
You must be signed in to change notification settings - Fork 923
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 memory leak on macOS #2092
Merged
kvark
merged 3 commits into
gfx-rs:master
from
xiaopengli89:fix-macos-encoder-label-leak
Oct 20, 2021
Merged
Fix memory leak on macOS #2092
kvark
merged 3 commits into
gfx-rs:master
from
xiaopengli89:fix-macos-encoder-label-leak
Oct 20, 2021
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
xiaopengli89
force-pushed
the
fix-macos-encoder-label-leak
branch
from
October 19, 2021 08:02
454d149
to
3a44e06
Compare
kvark
reviewed
Oct 19, 2021
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.
Thank you for identifying and fixing the issue!
Just a few notes before we proceed
kvark
approved these changes
Oct 20, 2021
kvark
added
the
PR: needs back-porting
PR with a fix that needs to land on crates
label
Oct 20, 2021
kvark
pushed a commit
to kvark/wgpu
that referenced
this pull request
Oct 22, 2021
* Fix memory RenderCommandEncoder, BlitCommandEncoder, label leak on macOS * Don't wrap autoreleasepool when blit command encoder is already active * Revert wrap set_label, instead focus on gfx-rs/metal-rs#218
kvark
pushed a commit
that referenced
this pull request
Oct 22, 2021
* Fix memory RenderCommandEncoder, BlitCommandEncoder, label leak on macOS * Don't wrap autoreleasepool when blit command encoder is already active * Revert wrap set_label, instead focus on gfx-rs/metal-rs#218
Published in wgpu-hal-0.11.4 |
kvark
removed
the
PR: needs back-porting
PR with a fix that needs to land on crates
label
Oct 22, 2021
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.
Connections
#1783
Description
If we run the water example and open the Activity Monitor, and then do nothing (especially do not move the mouse to the water window), we will observe that the memory of the water process will keep growing. If we use the AMD discrete graphics card, it will grow by several megabytes per second. Using Intel integrated graphics is several hundred kilobytes per second. If we do some operations on the water window (such as moving the mouse), the memory will be reclaimed.
Using Instruments to monitor the memory allocation, confirmed that RenderCommandEncoder, BlitCommandEncoder and label will not be recycled without interaction.
Wrap new_render_command_encoder, new_blit_command_encoder and set_label into an AR pool can resolve the problem.
Testing
Run the water example in the same way and observe the memory changes.