问题描述
在我的应用中,我收到了多次内存泄漏.该对象是 Malloc 48 字节,它始终源自负责的调用者 strdup.对象的历史记录只显示它被 Malloced,没有其他保留或释放.堆栈跟踪没有显示我的任何代码.我能挑出的唯一相关性是:
In my app, I have am receiving multiple memory leaks. The object is Malloc 48 bytes, and it always originates from the responsible caller strdup. The history of the object only shows it being Malloced, and no other retains or releases. The stacktrace doesn't show any of my code. The only bits of relevance that I can pick out are:
10 UIKit _UIGestureRecognizerSendActions
9 UIKit -[UIScrollView handlePan:]
8 UIKit -[UIScrollView _endPanWithEvent:]
7 UIKit -[UIScrollView(Static) _startTimer:]
6 CoreFoundation CFNotificationCenterAddObserver
5 CoreFoundation _CFXNotificationRegisterObserver
4 libnotify.dylib notify_register_dispatch
3 libnotify.dylib notify_register_mach_port
2 libnotify.dylib token_table_add
1 libsystem_c.dylib strdup
0 libsystem_c.dylib malloc
在地图视图上滚动时似乎会发生这种情况,但我不确定如何继续,因为堆栈中没有引用我的任何代码.我应该如何继续诊断此泄漏?
It seems to occur whilst scrolling on a map view, but I am unsure how to proceed as none of my code is referenced in the stack. How should I proceed in diagnosing this leak?
如果需要任何进一步的信息,请告诉我.
If any further information is required, please let me know.
问候,尼克
推荐答案
如果只有"48个字节,则所有证据都指向系统框架中的帧(即分配永远不会暴露给您的代码),并且有不是 10 万个,那么我 (a) 不会担心太多,但我会 (b) 立即通过 http://bugreport.apple.com/
If it is "only" 48 bytes, all evidence points to frames in the system frameworks (i.e. the allocation is never exposed to your code), and there are not 10s of thousands of 'em, then I (a) wouldn't worry about it too much, but I would (b) immediately file a bug via http://bugreport.apple.com/
附上您的应用程序的二进制文件和有关如何重现问题的说明.
Attach a binary of your application and instructions as to how to reproduce the issue.
这篇关于Obj-C:strdup 帧中 Malloc 48 字节的内存泄漏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!