Closed ulowen closed 2 months ago
in MVKQueue.mm:
- auto* mtlCmdBuff = getMTLCommandBuffer(cmdUse);
- [mtlCmdBuff commit];
- [mtlCmdBuff waitUntilCompleted];
+ @autoreleasepool
+ {
+ auto* mtlCmdBuff = getMTLCommandBuffer(cmdUse);
+
+ [mtlCmdBuff commit];
+ [mtlCmdBuff waitUntilCompleted];
+ }
seems to fix it. Is this a valid fix? If so I can pull request.
seems to fix it. Is this a valid fix? If so I can pull request.
Ah! Good catch, and fix! Thanks. Looks like we missed that @autoreleasepool
.
Yes, please submit a PR for this! It would be great if you could do it by Monday (May 6) so we can include it in the upcoming SDK release.
BTW...the style convention for MoltenVK is {
at the end of the line. So it would be @autoreleasepool {
.
Thanks!
Hi,
macOS version 13.0, Xcode version 14.2, Vulkan SDK version 1.3.280.0
I noticed my application's memory usage was growing steadily, I fired up instruments and found that vkQueueWaitIdle seems to regularly allocating a command buffer and it never being freed (screenshot attached). As a simple test case, I used https://github.com/SaschaWillems/Vulkan 's repo, compiling the
instancing
program and I observed the same memory growth associated with vkQueueWaitIdle. His code calls vkQueueWaitIdle like:My code was similar, however I was following the image transition section of this tutorial: https://vulkan-tutorial.com/Texture_mapping/Images
where the tutorial instructs you to use queues to synchronise image updates, like:
See below trace from leaks in instruments: