Closed Bug 309729 Opened 20 years ago Closed 20 years ago

When the memory cache is disabled (through about:config) and then re-enabled in the same session, the capacity remains at zero.

Categories

(Core :: Networking: Cache, defect)

defect
Not set
minor

Tracking

()

VERIFIED FIXED

People

(Reporter: alfredkayser, Assigned: alfredkayser)

Details

Attachments

(2 files)

Found during patching bug 308972: When the memory cache is disabled (through about:cache) and then re-enabled in the same session, the capacity remains at zero.
Did you mean "through about:config" instead?
Yep, and I am investigating an issue with mTotalSize getting negative...
Summary: When the memory cache is disabled (through about:cache) and then re-enabled in the same session, the capacity remains at zero. → When the memory cache is disabled (through about:config) and then re-enabled in the same session, the capacity remains at zero.
Another patch to memory cache: fixing the enabling/disabling of memory cache, by correctly 'SetCapacity' of the memory device, as well as more lazy memory cache device creation (so that it only happens from one place, when the cache service wants to store something in the memory cache). Also moved 'CacheMemoryAvailable' to 'MemoryCacheCapacity' of the PrefObserver, to be consistent with DiskCache, to move all 'preference' logic to the 'PrefObserver', and to reduce one member from nsServicCache.
Attachment #197397 - Flags: review?(darin)
Comment on attachment 197397 [details] [diff] [review] Patch to correctly disable/enable the memory cache device r=darin
Attachment #197397 - Flags: review?(darin) → review+
Attachment #197397 - Flags: superreview?(bzbarsky)
Attachment #197397 - Flags: superreview?(bzbarsky) → superreview+
Assignee: darin → alfredkayser
Fixed on trunk. Thanks for the patch, Alfred!
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
This hangs switching profiles.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment on attachment 197397 [details] [diff] [review] Patch to correctly disable/enable the memory cache device >@@ -1164,39 +1218,37 @@ void > nsCacheService::OnProfileChanged() > { > if (!gService) return; > > nsresult rv = NS_OK; > nsAutoLock lock(gService->mCacheServiceLock); <snip> >+ gService->SetMemoryCache(); The problem is that SetMemoryCache also tries to lock the lock...
Additional patch to fix the lock problem when switching profiles. * Move back the code within 'SetMemoryCache' to OnProfileChange to prevent double locking * Also reset mMemoryCacheCapacity to -1, if switching from profile with capacity set to one without a set capacity.
Attachment #199145 - Flags: review?(neil.parkwaycc.co.uk)
Comment on attachment 199145 [details] [diff] [review] Additional patch to not lock, and to correctly reset 'MemoryCacheCapacity' to -1 if not set in profile >- nsresult rv = NS_OK; I don't think moving this declaration inside the #ifdef is a good idea. I don't clam to understand the code, but it does at least prevent the hang, so marking r+ for that.
Attachment #199145 - Flags: review?(neil.parkwaycc.co.uk) → review+
Comment on attachment 199145 [details] [diff] [review] Additional patch to not lock, and to correctly reset 'MemoryCacheCapacity' to -1 if not set in profile The 'rv' was moved, because it is only used within the ifdef itself
Attachment #199145 - Flags: superreview?(bzbarsky)
Comment on attachment 199145 [details] [diff] [review] Additional patch to not lock, and to correctly reset 'MemoryCacheCapacity' to -1 if not set in profile This probably needs a look from darin...
Attachment #199145 - Flags: superreview?(bzbarsky) → superreview?(darin)
Comment on attachment 199145 [details] [diff] [review] Additional patch to not lock, and to correctly reset 'MemoryCacheCapacity' to -1 if not set in profile sr=darin
Attachment #199145 - Flags: superreview?(darin) → superreview+
Checked in that second patch on trunk.
Status: REOPENED → RESOLVED
Closed: 20 years ago20 years ago
Resolution: --- → FIXED
Thanks for fixing this. With Creature-Build 2005101120 my Problems with different Profiles after Checkin from first Patch are solved, so I would like to say its verified=fixed now.
V/fixed: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.9a1) Gecko/20051028 SeaMonkey/1.1a set browser.cache.memory.enable to false. about:cache - number of entries is zero. set browser.cache.memory.enable to true. about:cache - number immediately is non-zero. changed profile as well.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: