#50 leak with net/http

open
nobody
None
5
2008-11-09
2008-11-09
Anonymous
No

I'm new to Mac development, so please forgive me if I'm doing something wrong.

My simple web feed checking script leaks memory like a sieve. This is especially troublesome since I would like to leave it constantly running. I've pared it down to the attached test case. It creates a timer that fires every 3 seconds and uses net/http to retrieve an RSS feed. Commenting out the body of the connect method makes the leak go away.

I'll also attach the output of the leaks(1) program over the first 30 seconds of running my script. It shows that 2364720 bytes were leaked during that time.

Discussion

  • Nobody/Anonymous

    Oops, it looks like I can add only one attachment. Let me characterize the leaks(1) output then. There were many many lines that looked like this:

    Leak: 0x12011c00 size=8192
    0x00000000 0x00000000 0x00000000 0x00000000 ................
    0x00000000 0x00000000 0x00000000 0x00000000 ................
    0x00000000 0x00000000 0x00000000 0x00000000 ................
    0x00000000 0x00000000 0x00000000 0x00000000 ................
    0x00000000 0x00000000 0x00000000 0x00000000 ................
    0x00000000 0x00000000 0x00000000 0x00000000 ................
    0x00000000 0x00000000 0x00000000 0x00000000 ................
    0x00000000 0x00000000 0x00000000 0x00000000 ................
    ...

    Then there are many lines that look like this:

    Leak: 0x22ea40 size=32 instance of 'NSAutoreleasePool', type ObjC, implemented in Foundation
    0xa05659e0 0x00000000 0x00000000 0x00000000 .YV.............
    0x00000000 0x00000000 0x00000000 0x00000000 ................

     

Log in to post a comment.