Closed
Bug 53312
Opened 24 years ago
Closed 24 years ago
jar: implement memory flusher for zip cache
Categories
(Core :: Networking, defect, P3)
Core
Networking
Tracking
()
RESOLVED
FIXED
People
(Reporter: waterson, Assigned: dprice)
References
Details
(Keywords: memory-footprint)
Attachments
(5 files)
6.03 KB,
patch
|
Details | Diff | Splinter Review | |
12.02 KB,
patch
|
Details | Diff | Splinter Review | |
8.61 KB,
patch
|
Details | Diff | Splinter Review | |
8.73 KB,
patch
|
Details | Diff | Splinter Review | |
8.60 KB,
patch
|
Details | Diff | Splinter Review |
Per (my recollection of) jband's investigation, this was accounting for
something like 200K per JAR file or something? Need to hook up as a memory
pressure observer.
Reporter | ||
Updated•24 years ago
|
Assignee | ||
Comment 2•24 years ago
|
||
I'd like to start looking at this on Monday
Comment 3•24 years ago
|
||
We need to review the zip cache code at some point too. I've been occasionally
seeing the assertion "wacked" on line 1254 being hit. This indicates some sort
of race condition.
Comment 4•24 years ago
|
||
hey dprice, please attach the patches we worked on.
I'll attach the race condition crasher fix I did and sent to you guys last week.
I thought you guys were going to get this stuff in.
You have the flusher enabling changes on your machine. This should include
and superceed my changes. Please attach the patch.
The Jar protocol changes have us doing a lot of reading from these jars on
various threads right? That race problem could be crashing in rtm as it is now,
right? Let's get these checked into at least the trunk and get some burn in
time. If we want them in the rtm branch we better get moving.
Comment 5•24 years ago
|
||
Comment 6•24 years ago
|
||
warren, do you want to spin the race fix off to a separate (crasher?) bug?
Anyway, review needed.
Assignee | ||
Comment 8•24 years ago
|
||
Assignee | ||
Comment 9•24 years ago
|
||
diff includes fix for 55893
Comment 10•24 years ago
|
||
Dave, "diff -u" is our standard.
Assignee | ||
Comment 11•24 years ago
|
||
sr=warren,jband
Comment 12•24 years ago
|
||
Dave, please attach a diff -u of exactly what you intend to checkin... Those
non-#ifdef'd printfs are not going to get checked in, right?
Assignee | ||
Comment 13•24 years ago
|
||
checked in the fix
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 14•24 years ago
|
||
backed out the fix
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Comment 15•24 years ago
|
||
Comment 16•24 years ago
|
||
r=jband
Looks right. Passes the tests. flushes the files and does not crash when I
choose 'flush' in the debug menu.
A nit: you still have 3 tabs in the file. You ought to remove them. I suggest
you set your editor to not insert tabs. Many people have editors that actually
read and obey the 'Mode' line at the top of each file. When tabs *are* in the
file they had better follow the Mode line's 'tab-width' directive (2 in this
case). Note that "indent-tabs-mode: nil" says that new tabs should not be added.
Assignee | ||
Comment 17•24 years ago
|
||
Comment 18•24 years ago
|
||
r=jband
Thanks Dave.
Reporter | ||
Comment 19•24 years ago
|
||
Sorry to keep dribbling criticism :-(
- the Observe() method should be checking the "topic". Not that big of a deal
because the observer service will only notify for memory pressure stuff, but
it'll future proof the code (for when the zip cache starts spying on the next
door neighbors).
- there is no need to unregister from the observer service since you're a weak
ref (and doing so may trigger annoying "attempt to acquire service during XPCOM
shutdown" asserts)
- I don't really grok the other changes (e.g., "interval no timeout" semantics),
but trust jband. warren, maybe you could take a quick look at those to sanity check.
Make the above changes, get warren to look over the "interval no timeout" stuff,
and sr=waterson.
Assignee | ||
Comment 20•24 years ago
|
||
Comment 21•24 years ago
|
||
r=jband
I agree with waterson's suggestions - wish I'd thought of them! It looks like
you implemented the suggestions correctly.
Reporter | ||
Comment 22•24 years ago
|
||
This is unnecessary now:
nsZipReaderCache::~nsZipReaderCache()
{
+ nsresult rv;
if (mLock)
PR_DestroyLock(mLock);
And you should move the nsAutoLock inside the "if", but before the "while" (lock
minimal sections of code):
+nsZipReaderCache::Observe(nsISupports *aSubject,
+ const PRUnichar *aTopic,
+ const PRUnichar *aSomeData)
+{
+ nsAutoLock lock(mLock);
+
+ if (nsCRT::strcmp(aTopic, NS_MEMORY_PRESSURE_TOPIC) == 0) {
+ while (PR_TRUE)
Fix those two things (I don't need to see another diff). If warren is ok with
the other stuff, sr=waterson.
thanks for your patience!
Comment 23•24 years ago
|
||
Chris' last set of suggestions sound good to me. The interval no timeout stuff
seems right too. Make it so, Dave.
Assignee | ||
Comment 24•24 years ago
|
||
marking fixed
Status: REOPENED → RESOLVED
Closed: 24 years ago → 24 years ago
Resolution: --- → FIXED
Summary: implement memory flusher for zip cache → jar: implement memory flusher for zip cache
You need to log in
before you can comment on or make changes to this bug.
Description
•