I am in the final stages of tweaking my first iphone app for release and am trying to shave off kilobytes where I can. I have a process that syncs some data with my server on start of the app, and I noticed when I commented that out, my app is using 7MB when it is done starting. When I turn it on, it is using 18MB when it is done starting. I am now trying to determine what part of the process is eating the memory and not giving it back. I have turned off most of my sync function and am left with this and it still uses 2MB of memory and does not release it when it is done:
GDataXMLDocument *syncData = [[self getXmlWithUrl:@"http://SOMEURL"] autorelease];
This just uses my helper function to go out and load up a xml document for me to use. My helper function is as follows:
-(GDataXMLDocument*)getXmlWithUrl:(NSString*)url{
NSURLRequest *theRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:url]];
NSURLResponse *resp = nil;
NSError *err = nil;
NSData *response = [NSURLConnection sendSynchronousRequest: theRequest returningResponse: &resp error: &err];
return [[GDataXMLDocument alloc]initWithData:response options:0 error:&err];
}
I put a release after the syncData is created, but of course it says its already de-allocated. Any ideas on what could be causing this?