Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
527 views
in Technique[技术] by (71.8m points)

objective c - Obj-C: Memory Leak of Malloc 48 bytes in strdup frame

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.

Regards, Nick

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...