ios - Trying to understand NSURLCache and why I keep consuming memory -


my app makes lot of url requests (calling web service) in loop extended period of time. when watch app in allocations tool, see memory consumption going continuously during run of loop. testing purposes, i've reduced loop following, exhibits same behavior:

nsurl *myurl = [[nsurl alloc] initwithstring:@"http://my.server.com/webservice"]; nsurlrequest request = [[nsurlrequest alloc] initwithurl:myurl cachepolicy:nsurlrequestreloadignoringcachedata timeoutinterval:30]; while (1) {     nsautoreleasepool *pool = [[nsautoreleasepool alloc] init];     nsurlresponse *response = nil;     nserror *error = nil;      nsdata *rawresponse = [nsurlconnection sendsynchronousrequest:request returningresponse:&response error:&error];      [[nsurlcache sharedurlcache] removeallcachedresponses];     [pool release]; } 

when first discovered problem, figured because url requests/responses being cached. that's when added [[nsurlcache sharedurlcache] removeallcachedresponses]. expecting clear out cache after each call web service , free memory being used url caching purposes. no luck.

i must doing wrong, can't find it. barking wrong tree in thinking it's url caching? else be?


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -