Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8405119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T22:46:09+00:00 2026-06-09T22:46:09+00:00

I have found a memory leak in my application which is a ARC converted

  • 0

I have found a memory leak in my application which is a ARC converted application.

Instrument shows that leak responsible library is libsystem_c.dylib

I am attaching the screen shot here..

I have searched about the issue and i found the related posts in

instruments-show-leak-in-main-m-xcode-4-3-1

obj-c-memory-leak-of-malloc-48-bytes-in-strdup-framework

Is it a bug in the iOS 5.1 framework?

Any help on this is appreciated.

enter image description here

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T22:46:11+00:00Added an answer on June 9, 2026 at 10:46 pm

    EDIT:

    indeed, it seems there is some king of bug in iOS SDK 5.1 strdup (or related). See this thread from the developers forum.

    it would be interesting if you can dig a bit into the Elements sample (which is the one that is said to reveal the bug) and see if you are using the same kind of functionality.

    Here is a stack trace at the moment of the leak:

     0 libsystem_c.dylib malloc
     1 libsystem_c.dylib strdup
     2 libnotify.dylib token_table_add
     3 libnotify.dylib notify_register_mach_port
     4 libnotify.dylib notify_register_dispatch
     5 CoreFoundation _CFXNotificationRegisterObserver
     6 CoreFoundation CFNotificationCenterAddObserver
     7 UIKit -[UIScrollView(Static) _startTimer:]
     8 UIKit -[UIScrollView _endPanWithEvent:]
     9 UIKit -[UIScrollView handlePan:]
    10 UIKit _UIGestureRecognizerSendActions
    11 UIKit -[UIGestureRecognizer _updateGestureWithEvent:]
    12 UIKit ___UIGestureRecognizerUpdate_block_invoke_0541
    13 UIKit _UIGestureRecognizerApplyBlocksToArray
    14 UIKit _UIGestureRecognizerUpdate
    15 UIKit _UIGestureRecognizerUpdateGesturesFromSendEvent
    16 UIKit -[UIWindow _sendGesturesForEvent:]
    17 UIKit -[UIWindow sendEvent:]
    18 UIKit -[UIApplication sendEvent:]
    19 UIKit _UIApplicationHandleEvent
    20 GraphicsServices PurpleEventCallback
    21 CoreFoundation __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
    22 CoreFoundation __CFRunLoopDoSources0
    23 CoreFoundation __CFRunLoopRun
    24 CoreFoundation CFRunLoopRunSpecific
    25 CoreFoundation CFRunLoopRunInMode
    26 GraphicsServices GSEventRunModal
    27 UIKit UIApplicationMain
    28 TheElements 0x300a
    29 TheElements 0x2fc3
    

    You can get your stack trace at the moment of the leak by choosing “Show Extended Detail” (or something similar) in the Instruments View menu.

    OLD ANSWER:

    I suspect it is not.

    In fact, what Instruments shows you as “responsible library” is the place where the actual malloc call was effectively executed.

    If you look at Instruments output, the culprit call is strdup: there cannot possibly be a leak in strdup.

    It is more likely that you asked the OS (directly or indirectly) to duplicate some string, but then managed incorrectly the resulting copy of the string.

    Analyze the Extended Detail View which Instruments offer you, which shows the call stack at the moment the malloc was called. This may help if there is a direct relationship between your code and the malloc call itself. But even if the detailed view does not show such relationship, keep looking for the cause of the leak in your code.

    More in general, try to understand which part of your app is running when the leak is found (take into account the fact that leaks analysed at discrete times, e.g., every 10 seconds, so when you see the red bar appear, that means that the leak was produced during the last 10 seconds), and review all memory operations you do in the relevant classes.

    In my experience, it is pretty normal (100% of cases) that Instruments shows some part of the SDK as “responsible” for a leak, but at a deeper analysis the wrong code is on my part.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Anyone have a idea about solve memory leak issues i have found one memory
I have monitor my java application with profiler to know memory leak. And I
We have been going through a big memory leak analysis and have found one
Our app is getting hit pretty hard by a memory leak. I've found that
I have been looking into a memory leak issue for a while. I found
I have found a similar issue: NSMutableArray addObject in for loop - memory leak
Did a test on instrument and found memory leak for this piece of code
I have a test project which demonstrates a memory leak caused by Admob 4.1.1.
I have just resolved a memory leak in my application and now I want
I have found that I have no problem using require to load something like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.