Issue 136066 in chromium: --disk-cache-size switch and DiskCacheSize policy are ignored

131 views
Skip to first unread message

chro...@googlecode.com

unread,
Jul 5, 2012, 3:16:39 AM7/5/12
to chromi...@chromium.org
Status: Untriaged
Owner: ----
Labels: Type-Bug Pri-2 Feature-Enterprise Area-Internals
Feature-Media-Cache Internals-Network-Cache

New issue 136066 by joaod...@chromium.org: --disk-cache-size switch and
DiskCacheSize policy are ignored
http://code.google.com/p/chromium/issues/detail?id=136066

Version: 22.0.1195.0 (Developer Build 145294)
OS: Mac OS X 10.7

Reproducing with the switch:
- Start chrome with --user-data-dir=/tmp/data --disk-cache-size=10000000
- Open a bunch of websites and observe /tmp/data/Default/Cache blowing up

Reproducing with the policy:
- Set the DiskCacheSize policy to 10000000
- Open a bunch of websites and observe /tmp/data/Default/Cache blowing up

In both cases, chrome://net-internals/#httpCache shows that 10000000 is the
MaxSize but the CurrentSize easily exceeds it after opening ~8 tabs (see
the attached screenshot).

The --media-cache-size switch and MediaCacheSize policy weren't tested but
might have the same issue.

Attachments:
cache.png 71.4 KB

chro...@googlecode.com

unread,
Jul 5, 2012, 3:19:41 AM7/5/12
to chromi...@chromium.org
Updates:
Cc: pastarm...@chromium.org

Comment #1 on issue 136066 by mnis...@chromium.org: --disk-cache-size
switch and DiskCacheSize policy are ignored
http://code.google.com/p/chromium/issues/detail?id=136066

Julian, do yo have time to look into this?

chro...@googlecode.com

unread,
Jul 5, 2012, 5:39:45 AM7/5/12
to chromi...@chromium.org

Comment #2 on issue 136066 by pastarm...@chromium.org: --disk-cache-size
switch and DiskCacheSize policy are ignored
http://code.google.com/p/chromium/issues/detail?id=136066

I tried this and it seems that the cache size actually gets limited by the
flag but the correlation is not 1:1 as it should be. So giving a 10MB cache
limit can result into ~30MB of disk taken. The cache size translates in
some way into the number of entries per table but I am far from this code
to make clear conclusions. Also just the service structures created on disk
can take a few megs on their own even with no entries in the cache. This is
clearly visible if on simple clears the cache and observes the size of the
cache dir.

I am leaving it to the cache people to decide how to handle this.
Can we make it more predictable how does the cache limit really correlates
to the maximal used up disk size so that we can better document this
policy/flag or is it possible to make it so that the disk cache really
never grows beyond the given size?

chro...@googlecode.com

unread,
Jul 5, 2012, 5:42:25 AM7/5/12
to chromi...@chromium.org

Comment #3 on issue 136066 by joaod...@chromium.org: --disk-cache-size
switch and DiskCacheSize policy are ignored
http://code.google.com/p/chromium/issues/detail?id=136066

Interesting. This was surprising to me and is probably surprising to
administrators too. They may assign a certain quota to users and wish to
limit the cache used by Chrome, and yet this won't be predictable; for
instance, though Chrome's cache is limited to 20MB and the user has a 50MB
disk quota, Chrome may very well use up all the quota and the admin doesn't
have an easy way to control this :-/

chro...@googlecode.com

unread,
Jul 5, 2012, 5:49:15 AM7/5/12
to chromi...@chromium.org

Comment #4 on issue 136066 by simon....@gmail.com: --disk-cache-size
switch and DiskCacheSize policy are ignored
http://code.google.com/p/chromium/issues/detail?id=136066

When I set 50MB as a cache limit, Cache dir occupied more than 100MB.

chro...@googlecode.com

unread,
Jul 5, 2012, 12:50:56 PM7/5/12
to chromi...@chromium.org
Updates:
Status: Duplicate
Mergedinto: 81552

Comment #5 on issue 136066 by fisc...@chromium.org: --disk-cache-size
switch and DiskCacheSize policy are ignored
http://code.google.com/p/chromium/issues/detail?id=136066

(No comment was entered for this change.)

chro...@googlecode.com

unread,
Jul 12, 2012, 8:18:42 PM7/12/12
to chromi...@chromium.org

Comment #6 on issue 136066 by rvar...@google.com: --disk-cache-size switch
and DiskCacheSize policy are ignored
http://code.google.com/p/chromium/issues/detail?id=136066

The size should be roughly limited by the argument... so setting the limit
to 10 MB should not result in the cache reporting 19 MB.

However, we intentionally don't evict entries for the first few minutes of
browsing, so if you are just adding the command line, browsing and
immediately going over the limit, and looking at net-internals, the limit
will not be enforced quite yet.

Wait a few minutes before the test.

chro...@googlecode.com

unread,
Jul 12, 2012, 11:10:58 PM7/12/12
to chromi...@chromium.org

Comment #8 on issue 136066 by simon....@gmail.com: --disk-cache-size
switch and DiskCacheSize policy are ignored
http://code.google.com/p/chromium/issues/detail?id=136066

Hi, rvargas

Eviction works by TrimCache().
HttpCache calls TrimCache() when Entry is released.
How about call TrimCache() when New Entry is created for strict cache limit?
Does this idea make sense?

chro...@googlecode.com

unread,
Jul 12, 2012, 11:18:59 PM7/12/12
to chromi...@chromium.org
Updates:
Mergedinto: 81552

Comment #9 on issue 136066 by rva...@chromium.org: --disk-cache-size
switch and DiskCacheSize policy are ignored
http://code.google.com/p/chromium/issues/detail?id=136066

I guess I don't see what we would be fixing. Eviction is an asynchronous
condition that has some triggers... like having released a new entry
('cause this entry is now eligible for eviction, but if that makes a
difference we are on a test, or something is really broken).

Once the cache is doing evictions, it keeps doing that until there is some
room to grow again... but that doesn't mean that we stop or disallow
writing new stuff until we have more space.

Reply all
Reply to author
Forward
0 new messages