Conversation
|
@andyleiserson, could you please take this on, since you measured the original problem? @39ali: You have merge conflicts, and need to rebase. |
| self.counters.buffers.sub(1); | ||
| autoreleasepool(|_| { | ||
| drop(buffer); | ||
| }); |
There was a problem hiding this comment.
Can you explain in more detail how you found this (and the similar handling for QueueShared) to be necessary? Is the idea that releasing these objects transfers ownership of some member(s) to the autorelease pool, rather than directly releasing them?
There was a problem hiding this comment.
from my testings, it doesn't directly release them since there's no main release pool and that's because the code is not running inside Cocoa event loop so you have to manually autoreleasepool by yourself , there's probably a lot of places like this in the metal backend but this is what i currently found to be leaking
andyleiserson
left a comment
There was a problem hiding this comment.
I would prefer to omit creating autoreleasepools in Drop / destroy, unless there's compelling evidence it is necessary.
(For what it's worth, I tried running the fuzzing test case from #8018 with just the added autoreleasepools on non-destructor paths, and it did seem like the leak was resolved.)
Connections
should help fix #8018
Description
metal is leaking some strings and gpu device because metal resources hold a strong reference back to the MTLDevice
Testing
ran some custom tests that would keep creating/deleting resources
Squash or Rebase?
Squash
Checklist
cargo fmt.taplo format.cargo clippy --tests. If applicable, add:--target wasm32-unknown-unknowncargo xtask testto run tests.CHANGELOG.mdentry.