Strange memory cache behaviour

Discussion about official Mozilla Firefox builds
Post Reply
fxtech
Posts: 199
Joined: October 13th, 2008, 4:55 pm

Strange memory cache behaviour

Post by fxtech »

i think is quite strange , since last build the memory cache stop to save image but just the html code or js , all the image are stored only on the disk cache

in that way my memoru cache still almost empty for all the time

Memory cache device

Number of entries: 288
Maximum storage size: 32768 KiB
Storage in use: 1682 KiB
Inactive storage: 1682 KiB

List Cache Entries
Disk cache device

Number of entries: 1161
Maximum storage size: 131072 KiB
Storage in use: 12488 KiB
Cache Directory: C:\Temp\Browser Cache\Cache


List Cache Entries

new parameter are showed in about:config filter for cache

image.cache.size; integer 5242880

and

image.cache.timeweight; integer 500

what they do ?
User avatar
fswl1234
Posts: 245
Joined: October 15th, 2003, 4:32 pm

Re: Strange memory cache behaviour

Post by fswl1234 »

i tried the 3.1b1 candidate earlier and noticed the same thing (Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b1) Gecko/20081007 Firefox/3.1b1)
except my case is worse, most of the time "Memory cache device" doesn't even show up in about:cache
i wonder if it's cause the "Number of entries:" is 0 ? cause when it does show up, it's just like 1 or 3 or 5... single digit

as to the 2 prefs i found a brief description in all.js, not really clear though
// Image cache prefs
// The maximum size, in bytes, of the decoded images we cache
pref("image.cache.size", 5242880);
// A weight, from 0-1000, to place on time when comparing to size.
// Size is given a weight of 1000 - timeweight.
pref("image.cache.timeweight", 500);
fxtech
Posts: 199
Joined: October 13th, 2008, 4:55 pm

Re: Strange memory cache behaviour

Post by fxtech »

ok i have understand

// Image cache prefs
// The maximum size, in bytes, of the decoded images we cache
pref("image.cache.size", 5242880);

then , an image of 1024x1024 decoded will be bigger as 1024x1024x3 bytes , set it in image.cache.size and the images will be cached
fxtech
Posts: 199
Joined: October 13th, 2008, 4:55 pm

Re: Strange memory cache behaviour

Post by fxtech »

more evidence , no image are cached in memory, those are the results after 8 hours of browsing

Memory cache device

Number of entries: 32
Maximum storage size: 64000 KiB
Storage in use: 89 KiB
Inactive storage: 89 KiB


List Cache Entries
Disk cache device

Number of entries: 2880
Maximum storage size: 256000 KiB
Storage in use: 82386 KiB
Cache Directory: C:\Temp\Browser Cache\Cache

List Cache Entries
fxtech
Posts: 199
Joined: October 13th, 2008, 4:55 pm

Re: Strange memory cache behaviour

Post by fxtech »

the 3.0.4 trunk work as always

Memory cache device

Number of entries: 347
Maximum storage size: 128000 KiB
Storage in use: 23616 KiB
Inactive storage: 85 KiB

List Cache Entries
Disk cache device

Number of entries: 4336
Maximum storage size: 512000 KiB
Storage in use: 104003 KiB
Cache Directory: C:\Temp\Browser Cache\Cache

List Cache Entries
User avatar
fswl1234
Posts: 245
Joined: October 15th, 2003, 4:32 pm

Re: Strange memory cache behaviour

Post by fswl1234 »

tried the latest trunk (3.1), same problem

i was told it's very likely memory cache is actually working fine except that the data shown in about:cache is wrong, else i would've noticed some serious slowness or sort, which i have not perceived yet
however i do notice one thing, if i disable disk cache with browser.cache.disk.enable false, "Memory cache device" is back to normal right away

unless more people can confirm it (so far we're the only two), this is probably gonna be another mystery...
User avatar
jadjkorn64
Posts: 35
Joined: November 1st, 2008, 11:28 am

Re: Strange memory cache behaviour

Post by jadjkorn64 »

I think that this value possibly stores the amount of time that firefox spent to compare an cached image and the original image on internet, maybe their size, date of modification, an posibly CRC data.

it´s only a suposition, but it could be that.

bye

try it with lower or higher values in sites with lot of thumbnail images.
cliff101
Posts: 3
Joined: November 15th, 2008, 5:33 pm

Re: Strange memory cache behaviour

Post by cliff101 »

I can confirm that I found the same behavior described in the 2 posts above, after spending many hours troubleshooting.
I found this strange behavior independently, since I couldn't find similar posts on Google, until I discovered the 2 new preferences at the end of the all.js file and typed them in Google.
This is specific to FF 3.1 Beta 1, not in FF 3.0.x.
Maybe the developers could give us a clue, or they are still testing.
I couldn't find a reference to this modified behavior in the documentation published, I suppose it is done to address the complaints in regards to the excessive memory usage of FF.
fxtech
Posts: 199
Joined: October 13th, 2008, 4:55 pm

Re: Strange memory cache behaviour

Post by fxtech »

wow i am not mad !
User avatar
squall_leonhart
Posts: 885
Joined: March 17th, 2008, 5:32 am
Location: Australia
Contact:

Re: Strange memory cache behaviour

Post by squall_leonhart »

redhat71 wrote:tried the latest trunk (3.1), same problem

i was told it's very likely memory cache is actually working fine except that the data shown in about:cache is wrong, else i would've noticed some serious slowness or sort, which i have not perceived yet
however i do notice one thing, if i disable disk cache with browser.cache.disk.enable false, "Memory cache device" is back to normal right away

unless more people can confirm it (so far we're the only two), this is probably gonna be another mystery...


I also see this happening.
cliff101
Posts: 3
Joined: November 15th, 2008, 5:33 pm

Re: Strange memory cache behaviour

Post by cliff101 »

Logged the "bug" under https://bugzilla.mozilla.org/show_bug.cgi?id=465708
However, this seems to be desired behaviour, not really a bug.
I would be interested to hear what do you think about new RAM cache behaviour vs the old one.
fxtech
Posts: 199
Joined: October 13th, 2008, 4:55 pm

Re: Strange memory cache behaviour

Post by fxtech »

i prefer to be free to chose how it have to act , if i set the ram cache to zero no no ram will be waste if i set it to 128mbyte 128 mbyte will be used as always
User avatar
jadjkorn64
Posts: 35
Joined: November 1st, 2008, 11:28 am

Re: Strange memory cache behaviour

Post by jadjkorn64 »

to force Firefox to give priority to use the RAM instead of the hard disk
you sould create or modify this preference

preference: config.trim_on_minimize
type: boolean
value: false

I've tried it with 3.2a1pre and it works!
Long live to de Fox of Fire!
Post Reply