CFNetwork flash during image retrieval

I profile my application in Tools and have discovered an alarming amount of CFNetwork distributions when I use AFNetworking to retrieve a remote image.

In one instance, I saw 89 MB of distributions (image size is only about 200 KB). I added a screenshot to demonstrate. Has anyone else noticed this before? The memory is released accordingly, but I cannot understand why this is happening in the first place.

Profile

Thanks in advance.

+4
source share
1 answer

I see the same problem on iOS 8 ONLY. This does not happen on any version of iOS 7. On its simulator 132kb, on its device 144kb.

, :

https://github.com/AFNetworking/AFNetworking/issues/2314

http, nsurlsession . , keep-alive, google.com, kb. , keep-alive, .

NSString * url = [NSString stringWithFormat:@"%@%.20f", @"http://someplace.com/?test=", (double)[[NSDate date] timeIntervalSince1970];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:url]];
[request setHTTPMethod:@"GET"];
[[[NSURLSession sharedSession] dataTaskWithRequest:request completionHandler:nil] resume];

instruments

+3

All Articles