Re: NSURLConnection Without NSHTTPCookieStorage
Re: NSURLConnection Without NSHTTPCookieStorage
- Subject: Re: NSURLConnection Without NSHTTPCookieStorage
- From: John Stiles <email@hidden>
- Date: Wed, 9 Aug 2006 18:25:52 -0700
On Aug 9, 2006, at 5:59 PM, Michael Tsai wrote:
On Aug 9, 2006, at 6:12 PM, John Stiles wrote:
Without trying to be dismissive of the question, is there any
reason why this 500K is a problem for your app?
Well, this code will run in some small apps--essentially helpers
that will be open all the time. It seems like a shame to waste that
RAM. Also, it wouldn't surprise me if other people have a lot more
cookies than I do, so that more than 500K is used per app.
FWIW, it's entirely possible that very little of that space
actually consumes any real RAM; calloc'ing a 500K block typically
shouldn't force any existing pages out of RAM until someone
actually accesses the space.
Actually, it's not allocating a big block, but rather 7,000
NSHTTPCookie objects and 7,000 NSHTTPCookieInternal ones. So I
think it's using real RAM.
I'm embarrassed to say that when I ran ObjectAlloc again, no memory
was used for cookies. I guess turning them off *did* work, and
somehow that change (which was in a framework) didn't get
recompiled into the app before I did my test (unless there's some
other factor I'm not aware of). So perhaps the lesson here is that
it's well worth using -setHTTPShouldHandleCookies:.
LOL, well at least it's solved!
And yes, if it's allocating 14,000 tiny objects, that is definitely
real RAM being consumed. :)
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden