iOS libsystem_c.dylib strdup内存泄漏NSZombie无法正常工作 [英] iOS libsystem_c.dylib strdup memory leak NSZombie not working

查看:121
本文介绍了iOS libsystem_c.dylib strdup内存泄漏NSZombie无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请帮我跟踪iOS内存泄漏情况。谢谢!

Please help me track down an iOS memory leak. Thanks!

我正在使用xCode 4.0.1并尝试激活NSZombie以跟踪内存泄漏,但它似乎不像以前一样工作,使用xCode 3.x

I'm using xCode 4.0.1 and I tried to activate NSZombie to track a memory leak, but it doesn't seems to work as before, with xCode 3.x

我无法找到内存泄漏的来源,因为Instruments指出了这一点:

I can't find out where the memory leak is coming from, as Instruments points this out:

泄露对象 - >的 GeneralBlock-32
地址 - >的 0x4c8600
尺寸 - >的 32字节
负责图书馆 - >的 libsystem_c.dylib
负责帧/来电 - >的 strup

Leaked Object -> GeneralBlock-32 Address -> 0x4c8600 Size -> 32 Bytes Responsible Library -> libsystem_c.dylib Responsible Frame/Caller -> strup

目前这一点我不知道如果我正在使用乐器与NSZombie正确使用xCode 4,因为当我点击i获取更多信息时,它不会显示NSZombie选项。 。左边的选项泄漏

At this point I don't know If I'm using Instruments with NSZombie the right way with xCode 4, as it doesn't show the NSZombie option when I click "i" for more information, under the left option Leaks.

观察:我的iPhone应用程序播放实时流MMS / WMA以及WMA音频文件有限的a时间的安装。使用有限的wma文件,发生泄漏,但当我从流式传输源播放时完全,没有结束时间。

OBSERVATION: My iPhone application plays a live stream mms/wma and also wma áudio files with a finite amount of time. The leak happens only with a finite wma file, but runs perfectly when I'm playing from a streamed source, with no ending time.

推荐答案

首先,这是一个 malloc 块,而不是一个对象。僵尸不会工作(也不会在之前的版本中工作)。

First, that is a malloc block, not an object. Zombies won't work (and would never have worked in prior versions either).

这次泄漏发生了多少次?一旦?别担心。每个流一次?提交一个错误 - 到目前为止你的代码中没有这个错误(除非你的代码正在调用 strdup ,这在大多数iOS应用程序中肯定是可能的但不典型没有大量使用第三方库...是吗?)

How many times does that leak happen? Once? Don't worry about it. Once per stream? file a bug -- that isn't in your code from what you have posted so far (unless your code is calling strdup, which is certainly possible but atypical in most iOS apps that aren't making heavy use of third party libraries... are you?)

在任何情况下,除非它在整个过程中泄漏100s和100s的32字节分配你的应用程序的运行时,不要担心它(但请提出错误)。

In any case, unless it is leaking 100s and 100s of 32 byte allocations across the runtime of your app, don't worry about it (but please do file a bug).

正如Valkio所说,你可以从gdb中获取分配的堆栈跟踪(或从仪器)直接。

As Valkio said, you can grab the stack trace of the allocation from gdb (or from Instruments) directly.

这篇关于iOS libsystem_c.dylib strdup内存泄漏NSZombie无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆