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)
Core
Networking: Cache
Tracking
()
VERIFIED
FIXED
People
(Reporter: alfredkayser, Assigned: alfredkayser)
Details
Attachments
(2 files)
12.73 KB,
patch
|
darin.moz
:
review+
bzbarsky
:
superreview+
|
Details | Diff | Splinter Review |
3.59 KB,
patch
|
neil
:
review+
darin.moz
:
superreview+
|
Details | Diff | Splinter Review |
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.
Comment 1•20 years ago
|
||
Did you mean "through about:config" instead?
Assignee | ||
Comment 2•20 years ago
|
||
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.
Assignee | ||
Comment 3•20 years ago
|
||
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 4•20 years ago
|
||
Comment on attachment 197397 [details] [diff] [review]
Patch to correctly disable/enable the memory cache device
r=darin
Attachment #197397 -
Flags: review?(darin) → review+
Assignee | ||
Updated•20 years ago
|
Attachment #197397 -
Flags: superreview?(bzbarsky)
![]() |
||
Updated•20 years ago
|
Attachment #197397 -
Flags: superreview?(bzbarsky) → superreview+
![]() |
||
Updated•20 years ago
|
Assignee: darin → alfredkayser
![]() |
||
Comment 5•20 years ago
|
||
Fixed on trunk. Thanks for the patch, Alfred!
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Comment 6•20 years ago
|
||
This hangs switching profiles.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 7•20 years ago
|
||
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...
Assignee | ||
Comment 8•20 years ago
|
||
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 9•20 years ago
|
||
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+
Assignee | ||
Comment 10•20 years ago
|
||
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 11•20 years ago
|
||
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 12•20 years ago
|
||
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+
![]() |
||
Comment 13•20 years ago
|
||
Checked in that second patch on trunk.
Status: REOPENED → RESOLVED
Closed: 20 years ago → 20 years ago
Resolution: --- → FIXED
Comment 14•20 years ago
|
||
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.
Comment 15•20 years ago
|
||
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.
Description
•