• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: knowing when WebView is done
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: knowing when WebView is done


  • Subject: Re: knowing when WebView is done
  • From: Timothy Ritchey <email@hidden>
  • Date: Wed, 11 Jun 2008 09:42:45 -0400

Adam,
Thank you very much for that link. It was extremely helpful, and setting WebCacheModelDocumentViewer made the memory usage much cleaner. At the end of the day, I was still unhappy with the amount of memory WebKit was using in the application, so I decided to go a different route. I created a subproject WebKitHelper background application that I spin off using NSTask. That helper grabs the favicon and renders the thumbnail, pipes them both back to the main application, and then exits. Now, I don't have to worry about how much memory is getting used, or when I can safely release the WebView, etc. When I've got everything I need, WebKitHelper terminates, and I'm good to go. If anyone is interested in that code, let me know, and I will wrap it up and upload it somewhere.



On Jun 7, 2008, at 11:02 AM, Adam R. Maxwell wrote:


On Jun 7, 2008, at 6:26 AM, Timothy Ritchey wrote:


On Jun 7, 2008, at 1:32 AM, Adam R. Maxwell wrote:

From a quick check with Instruments, it looks like internal WebKit stuff is retaining the view for callbacks even after it's done loading, then releasing it on a later pass through the runloop. I wouldn't worry about it unless you're actually leaking the object.

From what I can tell by watching several instrument runs, it seems like WebKit is internally caching stuff. If I go to cnn.com, I see a major memory bump, but I can go to it again and again and not see any increase, but when I go to a new website, say digg.com, I see another memory bump again. Even if I let the application run for a while, it never seems to go back down. The only reason I am using webkit is to grab these thumbnails, which happens once, and need to be refreshed very rarely, if ever. I'm trying to read up on how to alter the caching behavior of WebKit now.

Sounds like we have similar usage scenarios. You have to read the header to find out about caching behavior, but I set it to WebCacheModelDocumentViewer for lowest memory usage, since I draw the webview to a bitmap and never load it again. I also set the WebView prefs to disable plugins and other stuff as well; the code is all BSD licensed, if you're curious.


http://tcobrowser.svn.sf.net/svnroot/tcobrowser/trunk/bibdesk/vendorsrc/amaxwell/FileView/FVWebViewIcon.m

--
Adam

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: knowing when WebView is done (From: Mark Bateman <email@hidden>)
 >Re: knowing when WebView is done (From: Rush Manbert <email@hidden>)
 >Re: knowing when WebView is done (From: Timothy Ritchey <email@hidden>)
 >Re: knowing when WebView is done (From: "Adam R. Maxwell" <email@hidden>)
 >Re: knowing when WebView is done (From: Timothy Ritchey <email@hidden>)
 >Re: knowing when WebView is done (From: "Adam R. Maxwell" <email@hidden>)
 >Re: knowing when WebView is done (From: Timothy Ritchey <email@hidden>)
 >Re: knowing when WebView is done (From: "Adam R. Maxwell" <email@hidden>)

  • Prev by Date: Re: Link to zlib
  • Next by Date: How to manage/embed Covert Art from Mp3 Files with Cocoa App?
  • Previous by thread: Re: knowing when WebView is done
  • Next by thread: Re: knowing when WebView is done
  • Index(es):
    • Date
    • Thread