#469 NSMutableURLRequest leaks on upload

iphone_1.9.x
open
nobody
7
2017-08-03
2009-10-26
No

This issue was moved here from #2881083.
We saw it first in svn 1543 (after release of version 1.4.6). It happens on simulator (Version 3.0 (138)) and on device (OS 3.0.1).
It was compiled with XCode Version 3.1.3.
We have it not yet reported to Apple, we want first verifiy if it is still an issue with the newest SDK which comes with snow leopard.

Description:
NSMutableURLRequest has a (private?) property with the retaining setter setHTTPBodyStream; however, it does not release this stream on dealloc.
Unfortunately the NSURLConnection creates a deep copy of the NSMutableURLRequest.

Discussion

  • Christa Runge

    Christa Runge - 2009-10-26

    TODO:
    - try to find out whether the issue is in the lower API layers (with the OS on the phone) or in the upper layers (linked to the application).
    - write a test application to reproduce the issue and discuss it with the folks at the chat.
    - the workaround will over-release the stream to compensate for the missing release.
    - the work-around must check at runtime if the bug is still there - else it will over-release the stream indeed and crash.
    - maybe it can catch the resulting exception instead.

     
  • Christa Runge

    Christa Runge - 2009-12-30

    svn 1783: extended the test code.
    A very strange observation: I have executed it on the Simulator under the debugger (XCode 3.1.3) but the retain count seems to go never to 0.
    After alloc + init the retain count is 1 as expected, after release it is still 1 - why ??
    Is this an effect of the Simulator? or of the debugger?
    I remember to have seen very useful retain counts in the past.

    Needs more analysis on the device and without the debugger.

     
  • Christa Runge

    Christa Runge - 2017-07-29

    Ticket moved from /p/karatasi/api-sdk-issues/9/

    Can't be converted:

    • _milestone: iPhone_OS_/_SDK_3.0
     
  • Christa Runge

    Christa Runge - 2017-07-29
    • Milestones: iPhone_OS_/_SDK_3.0 --> future
     
  • Christa Runge

    Christa Runge - 2017-08-03
    • Milestone: future --> iphone_1.9.x
     
  • Christa Runge

    Christa Runge - 2017-08-03

    1) According to the API documentation, the retainCount method should not be used, and we should be aware that resources can be released with a delay.
    2) Since karatasi 1.9.4 we implement the HTTP protocol with a different API.
    3) The recommended method to detect memory leaks is a static tool-based analysis.

    TODO: perform such a static analysis and verify if this issue is still present.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks