CF Network memory leak? Or false positive in Leaks?
CF Network memory leak? Or false positive in Leaks?
- Subject: CF Network memory leak? Or false positive in Leaks?
- From: Lawrence Johnston <email@hidden>
- Date: Sun, 17 Aug 2008 19:40:18 -0700
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:
- (IBAction)makeConnection {
// Set up fields for request
NSString *headerFieldName = [NSString stringWithString:@"Content-
Type"];
NSString *headerFieldValue = [NSString stringWithString:@"text/xml;
charset=utf-8"];?
NSURL *url = [NSURL URLWithString:@"http://192.168.1.145/*****WebService/*****Service.asmx
"];
NSString *soapAction = [NSString stringWithString:@"http://tempuri.org/Get*****
"];
NSData *body = [[NSString stringWithString:
@"<?xml version=\"1.0\" encoding=\"utf-8\"?
><soap:Envelope "
@"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance
\" "
@"xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" "
@"xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/
\"><soap:Body>"
@"<GetDashboard xmlns=\"http://tempuri.org/\" /></
soap:Body></soap:Envelope>"]
dataUsingEncoding:NSUTF8StringEncoding];
// Set up request
NSMutableURLRequest *myRequest = [[NSMutableURLRequest alloc]
initWithURL:url];
[myRequest setValue:headerFieldValue
forHTTPHeaderField:headerFieldName];
[myRequest setValue:soapAction forHTTPHeaderField:[NSString
stringWithString:@"SOAPAction"]];
[myRequest setHTTPBody:body];
[myRequest setHTTPMethod:[NSString stringWithString:@"POST"]];
[myRequest setTimeoutInterval:5]; // In seconds
// Make request
[NSURLConnection connectionWithRequest:myRequest delegate:self];
NSLog(@"connection sent");
[myRequest release];
}
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?
Thanks.
-L
_______________________________________________
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