Summary: | Fix authentication with NetworkSession | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Alex Christensen <achristensen> | ||||
Component: | New Bugs | Assignee: | Alex Christensen <achristensen> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | beidson | ||||
Priority: | P2 | ||||||
Version: | WebKit Nightly Build | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Alex Christensen
2016-02-01 16:32:38 PST
Created attachment 270456 [details]
Patch
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.
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; } (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+ |