Closed kevinmore closed 2 hours ago
Hi, I'm trying to use the Upscalar to upscale a video stream to 4K at real time. I noticed a significant memory leak.
My assumption is that the the CVMetal textures are not released properly in the upscaleCommandBuffer function.
Stack trace:
IOSurfaceClientCreateChild -[IOSurface initWithProperties:] IOSurfaceCreate CVPixelBufferBacking::performStandardMemoryLayoutAndCopyIOSurfaceCreationProperties(void*, unsigned char, __CFAllocator const*, __CFDictionary const*, __CFDictionary const*, __CFDictionary const*, __CFDictionary const*, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, void**, unsigned long*, unsigned long*, unsigned long*, unsigned long*, unsigned long*, __IOSurface**, __IOSurface*, __CVBuffer*, unsigned int*, unsigned long*, void**, __CFDictionary const**) _CVPixelBufferStandardMemoryLayout(void*, __CFAllocator const*, __CFDictionary const*, __CFDictionary const*, __CFDictionary const*, __CFDictionary const*, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, void**, unsigned long*, unsigned long*, unsigned long*, unsigned long*, unsigned long*, __IOSurface**, __IOSurface*, __CVBuffer*, unsigned int*, unsigned long*, void**) CVPixelBufferBacking::initWithPixelBufferDescription(unsigned long, unsigned long, void*, unsigned long, unsigned long, unsigned long, void**, unsigned long*, unsigned long*, unsigned long*, void (*)(void*, void const*), void (*)(void*, void const*, unsigned long, unsigned long, void const**), void*, __CFDictionary const*, __CFDictionary const*, __IOSurface*, __IOSurface*, __CVBuffer*, unsigned long*, int*) CVPixelBufferPool::createPixelBuffer(__CFAllocator const*, __CFDictionary const*, int*) CVPixelBufferPoolCreatePixelBuffer closure #1 in implicit closure #1 in Upscaler.upscaleCommandBuffer(_:pixelBufferPool:outputPixelBuffer:) Upscaler.upscale(_:pixelBufferPool:outputPixelBuffer:)
Profiling screenshot here:
Silly me. In my case, I need to wrap the upscale() call into an auto realse pool. Closing it now, thanks!
autoreleasepool { upscale() }
Hi, I'm trying to use the Upscalar to upscale a video stream to 4K at real time. I noticed a significant memory leak.
My assumption is that the the CVMetal textures are not released properly in the upscaleCommandBuffer function.
Stack trace:
Profiling screenshot here: