RESOLVED FIXED 153779
Fix authentication with NetworkSession
https://bugs.webkit.org/show_bug.cgi?id=153779
Summary Fix authentication with NetworkSession
Alex Christensen
Reported 2016-02-01 16:32:38 PST
Fix authentication with NetworkSession
Attachments
Patch (10.93 KB, patch)
2016-02-01 17:21 PST, Alex Christensen
beidson: review+
Alex Christensen
Comment 1 2016-02-01 17:21:53 PST
Brady Eidson
Comment 2 2016-02-02 14:56:54 PST
Comment on attachment 270456 [details] Patch This looks good. I am concerned about the footprint ramifications of creating two NSURLSessions per SessionID as opposed to one. If a user has many private browsing tabs, that's almost doubling their NetworkProcess memory footprint. PROBABLY not a big deal... unless it IS a big deal. In which case we need to know. I asked Alex to try to gather some footprint metrics.
Alex Christensen
Comment 3 2016-02-02 15:11:54 PST
I estimate each unused NSURLSession to use about 3 KB of memory based on the following data: // clang++ memtest.mm -framework Foundation && ./a.out #import <Foundation/NSOperation.h> #import <Foundation/NSURL.h> #import <Foundation/NSURLCredential.h> #import <Foundation/NSURLSession.h> int main() { /* numSessions memory footprint 0 0.69 MB 100 1.4 MB 1000 4.3 MB 10000 33.8 MB 100000 329.6 MB */ const int numSessions = 100000; for (int i=0;i<numSessions;i++) { NSURLSession *session = [NSURLSession sessionWithConfiguration:[NSURLSessionConfiguration ephemeralSessionConfiguration] delegate:nil delegateQueue:[NSOperationQueue mainQueue]]; [session retain]; } while(1); return 0; }
Brady Eidson
Comment 4 2016-02-02 15:14:13 PST
(In reply to comment #3) > I estimate each unused NSURLSession to use about 3 KB of memory based on the > following data: > > // clang++ memtest.mm -framework Foundation && ./a.out > > #import <Foundation/NSOperation.h> > #import <Foundation/NSURL.h> > #import <Foundation/NSURLCredential.h> > #import <Foundation/NSURLSession.h> > > int main() { > /* > numSessions memory footprint > 0 0.69 MB > 100 1.4 MB > 1000 4.3 MB > 10000 33.8 MB > 100000 329.6 MB > */ > const int numSessions = 100000; > for (int i=0;i<numSessions;i++) { > NSURLSession *session = [NSURLSession > sessionWithConfiguration:[NSURLSessionConfiguration > ephemeralSessionConfiguration] delegate:nil delegateQueue:[NSOperationQueue > mainQueue]]; > [session retain]; > } > while(1); > return 0; > } I don't know what the threshold is for "too big", but that's definitely under it. R+
Alex Christensen
Comment 5 2016-02-02 15:43:06 PST
Note You need to log in before you can comment on or make changes to this bug.