Re: CF Network memory leak? Or false positive in Leaks?
Re: CF Network memory leak? Or false positive in Leaks?
- Subject: Re: CF Network memory leak? Or false positive in Leaks?
- From: Jason Coco <email@hidden>
- Date: Mon, 18 Aug 2008 03:55:29 -0400
On Aug 17, 2008, at 22:40 , Lawrence Johnston wrote:
Hey everybody,
I've got a situation I'm kind of puzzling over. If I run my program
though leaks, I'm getting a leak at a certain point, but where it's
coming from is really confusing me.
I've pulled the urlRequest entirely out into a new dummy program and
I'm still getting a leak here.
This is the code I'm using:
[snip]
and then if I run it using a leak I'm getting a leak, for example
the last time I got a leak of size 3.58KB at 0.16 minutes (9.6
seconds).
The leak is as follows:
# Category Event Type Timestamp Address
Size Responsible Library Responsible Caller
0 GeneralBlock -3584 Malloc 00:05.538 0x83b200
3584 CFNetwork httpWrFilterOpen
1 GeneralBlock -3584 Free 00:14.539 0x83b200
-3584 libSystem.B.dylib _pthread_body
2 GeneralBlock -2048 Realloc 00:14.703 0x83b200
2048 CFNetwork sendDidReceiveDataCallback
The weird part is as far as I can tell the memory in question is
actually getting released! (at 14 seconds)
So is this some sort of weird false positive? Or am I missing
something?
It looks to me like the 3.58KB was released... that's number 1 on your
list, so there is not leak. The memory you have
allocated (2048 bytes) looks like it's the read buffer that was
created for you and which you either haven't read yet
or simply hasn't been released yet. CFNetwork may also keep the buffer
around in case you call it again to avoid
allocating and reallocating memory all the time.
/jason
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden