Temporary cache removal

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Temporary cache removal

Postby rnelson » Thu Feb 26, 2015 5:43 pm

I'm using up to a 1000 instances of CEF for load testing on a Linux Redhat server. I noticed that every time a CEF instance is created a temporary cache directory is created in the /tmp directory, like this

drwx------ 4 4096 Feb 26 22:23 .org.chromium.Chromium.049z0T
drwx------ 4 4096 Feb 26 22:24 .org.chromium.Chromium.09sqJN
drwx------ 4 4096 Feb 26 22:21 .org.chromium.Chromium.0rLvP7
drwx------ 4 4096 Feb 26 22:23 .org.chromium.Chromium.0SykaL
drwx------ 3 4096 Feb 26 22:24 .org.chromium.Chromium.12f7Nr
.
.
.
I always call CefShutdown() before exiting my program, but there are times this temporary cache does not get removed. And after awhile, the disk space gets filled with these temporary files that are no longer used. I'm using CEF version 3.1750.1738. Is there a way to find out the temporary cache directory name when a CEF browser instance is created?

Is there a way to not use or disable this temporary cache space?
rnelson
Newbie
 
Posts: 2
Joined: Thu May 29, 2014 5:46 pm

Re: Temporary cache removal

Postby magreenblatt » Thu Feb 26, 2015 11:44 pm

The temporary disk cache will be replaced by a completely in-memory cache with an upcoming change to trunk. In the mean time you can specify the cache path yourself via CefSettings.cache_path and then explicitly delete the folder after calling CefShutdown.
magreenblatt
Site Admin
 
Posts: 12402
Joined: Fri May 29, 2009 6:57 pm

Re: Temporary cache removal

Postby luodijia » Fri Feb 27, 2015 2:57 am

When will this change commit?
luodijia
Techie
 
Posts: 37
Joined: Mon Dec 22, 2014 11:55 am

Re: Temporary cache removal

Postby magreenblatt » Fri Feb 27, 2015 11:38 am

luodijia wrote:When will this change commit?

Within the next week, give or take.
magreenblatt
Site Admin
 
Posts: 12402
Joined: Fri May 29, 2009 6:57 pm

Re: Temporary cache removal

Postby rnelson » Tue Mar 03, 2015 3:57 pm

Using CefSettings.cache_path seems to work. I was worried that all Cef instances would share the same cache if I used it, but looks like each one is only using the cache_path I specified when creating a new instance, as long as the cache_path is unique. And I can remove the cache when the cef instance is done, which is what I want. Thanks for the quick reply.

For the in-memory cache coming in the next release, now I'm worried about running out of memory. Will there be a way to control the size of cache?
rnelson
Newbie
 
Posts: 2
Joined: Thu May 29, 2014 5:46 pm

Re: Temporary cache removal

Postby magreenblatt » Tue Mar 03, 2015 4:38 pm

rnelson wrote:For the in-memory cache coming in the next release, now I'm worried about running out of memory. Will there be a way to control the size of cache?

That's actually a valid concern :). There is no explicit way to limit the cache size. However, Chromium is supposed to be smart and not use more memory than what is currently available. It would be nice if you could test that with your use case and report back with any findings (good or bad). You can also continue to use the cache_path approach that you're using currently if that behaves better for you.

magreenblatt wrote:
luodijia wrote:When will this change commit?

Within the next week, give or take.

These changes landed in https://code.google.com/p/chromiumembed ... ail?r=2040.
magreenblatt
Site Admin
 
Posts: 12402
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 44 guests