简体   繁体   English

iOS广播内存泄漏

[英]iOS broadcast memory leak

I am testing ReplayKit broadcast extension with instruments. 我正在用仪器测试ReplayKit广播扩展。 I fixed some leaks on my extension, but some of leaks happens on Framework side and I cannot find a way to resolve. 我修复了扩展程序上的一些漏洞,但是某些漏洞发生在Framework方面,我找不到解决方法。 Anyone knows how to fix? 有人知道如何解决吗? It leaks 48Kbyte every .5 sec. 每0.5秒泄漏48 KB。

I checked History of the memory address. 我检查了内存地址的历史记录。 Retain delta is +0. 保留增量为+0。 Retain and Release is well paired including these functions, 保留和释放功能很好地配对,包括以下功能,

[_NSPlaceholderData initWithBytes:length:copy:deallocator:]
[NSXPCDecoder _decodeArrayOfObjectsForKey:]_block_invoke  
[RPBroadcastSampleHandler _processPayloadWithAudioSample:type:]_block_invoke
[RPBroadcastSampleHandler _audioBufferListFromData:]

My processSampleBuffer() returns immediately for testing. 我的processSampleBuffer()立即返回进行测试。 So leak is not happens my processSampleBuffer(). 所以我的processSampleBuffer()不会发生泄漏。

Screenshot of Xcode instruments Xcode工具的屏幕截图

This stack log is taken by Zombies instruments. 该堆栈日志由僵尸仪器获取。 Zombies changes debuggee's behavior of autorelease(), it keep the auto-released object. 僵尸更改了debuggee的autorelease()行为,它保留了自动释放的对象。

By comparing Zombies instruments result with Allocations instruments result, I found the auto-released object is freed on Allocations. 通过比较Zombies工具结果与Allocations工具结果,我发现自动释放的对象在Allocations上被释放。 So memory leak is not happens on the object. 因此,不会在对象上发生内存泄漏。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM