Closed
Bug 56644
Opened 24 years ago
Closed 24 years ago
one-time large leak in wallet
Categories
(Toolkit :: Form Manager, defect, P3)
Tracking
()
RESOLVED
FIXED
People
(Reporter: dbaron, Assigned: morse)
Details
(Keywords: memory-leak)
Attachments
(7 files)
1.45 KB,
patch
|
Details | Diff | Splinter Review | |
3.33 KB,
patch
|
Details | Diff | Splinter Review | |
16.23 KB,
patch
|
Details | Diff | Splinter Review | |
22.56 KB,
patch
|
Details | Diff | Splinter Review | |
24.44 KB,
patch
|
Details | Diff | Splinter Review | |
25.00 KB,
patch
|
Details | Diff | Splinter Review | |
24.97 KB,
patch
|
Details | Diff | Splinter Review |
The first time I submit a form, wallet allocates the following objects that are
never freed:
* 144K of nsStr (excluding their buffers!)
* 173K of wallet_MapElement
* 12K of wallet_Sublist
If these objects are meant to last the life of the component, then they should
be freed in wallet's module destructor so they don't clutter up the leak stats.
If they're not, then they should be deleted sooner.
The latter two objects should also be added to the leak stats. I'll attach a
patch for review that does that.
STEPS TO REPRODUCE:
* load this page
* hit commit (without changing anything!)
Reporter | ||
Comment 1•24 years ago
|
||
Reporter | ||
Comment 2•24 years ago
|
||
Comment 3•24 years ago
|
||
This seems like a _lot_ of memory to be used for submitting a form: were you
using some huge form to test, dbaron?
Steve: any guidance on the lifecycle for these strings-and-such?
Assignee | ||
Comment 4•24 years ago
|
||
What's happening is that the wallet tables are being read in. Their lifetime is
the lifetime of the browser session. See related bug 50295.
Assignee | ||
Updated•24 years ago
|
Status: NEW → ASSIGNED
Target Milestone: --- → M19
Assignee | ||
Comment 5•24 years ago
|
||
Patch looks good to me. r=morse
Comment 6•24 years ago
|
||
sr=scc
Reporter | ||
Comment 7•24 years ago
|
||
OK, the logging is checked in. This bug now returns to its original purpose
after an unscheduled interruption...
Assignee | ||
Updated•24 years ago
|
Target Milestone: M19 → M20
Assignee | ||
Updated•24 years ago
|
Summary: one-time large leak in wallet → [x]one-time large leak in wallet
Target Milestone: M20 → ---
Assignee | ||
Comment 8•24 years ago
|
||
Assignee | ||
Comment 9•24 years ago
|
||
Assignee | ||
Updated•24 years ago
|
Summary: [x]one-time large leak in wallet → [w]one-time large leak in wallet
Assignee | ||
Comment 10•24 years ago
|
||
Assignee | ||
Comment 11•24 years ago
|
||
Assignee | ||
Comment 12•24 years ago
|
||
Assignee | ||
Updated•24 years ago
|
Summary: [w]one-time large leak in wallet → one-time large leak in wallet
Whiteboard: [w]
Assignee | ||
Comment 13•24 years ago
|
||
Comment 14•24 years ago
|
||
r=dveditz
Assignee | ||
Comment 15•24 years ago
|
||
A quick note on the above patches. The next-to-last patch (id=19555) is
for wallet.cpp, wallet.h, and nsWalletService.cpp. The last patch (id=19773)
contains additional changes for wallet.cpp only -- the changes for wallet.h
and nsWallet.cpp from the preceding patch are still valid.
Comment 16•24 years ago
|
||
this looks like it will work, but issues I'm having with it:
- what is "item1" vs. "item2" and so forth? since we need to touch all the item*
variables anyway, can we give them better names so we actually understand what
this patch does?
- what's the difference between wallet_Sublist and wallet_HelpMac - I'm not
entirely sure from the patch, but can they be combined into one class?
- you took out "PRIVATE PRBool" from wallet_IsFromCartman, which means the
return type is not well-defined... at the very least it needs a type, but I'm
guessing that the removal of that line was unintentional.
- nsAutoStrings in classes - shouldn't they be nsStrings? it doesn't really
matter if these are singleton classes, but that's not clear to me
Assignee | ||
Comment 17•24 years ago
|
||
The data structure consists of mapping tables that map one item into another.
The actual interpretation of the items depend on which table we are in. For
example, if in the field-to-schema table, item1 is a field name and item2 is a
schema name. Whereas in the schema-to-value table, item1 is a schema name and
item2 is a value. Therefore the generic data structure refers to them simply as
item1 and item2.
wallet_sublist and wallet_helpmac contain entirely different data structures --
one consists of a single string, the other consists of four strings. Sure, I
could use the same class for both, but it would be quite wasteful for
wallet_sublist and there are many more instances of it than there are of
wallet_helpmac.
Yes, the removal of the type from wallet_IsFromCartman was purely accidental.
I'll restore that immediately. Thanks for catching that.
The only class that has nsAutoString in it is wallet_helpmac. Yes, those are
singleton classes. It significantly speeds up the table-read-in phase on the
mac by having the four nsAutoString statically allocated and re-used over and
over. The comment preceding the class declaration explains this.
Assignee | ||
Comment 18•24 years ago
|
||
Comment 19•24 years ago
|
||
ok, sounds reasonable to me - my only request is for a comment in the class
declaration saying basically what you said (i.e. "generally, item1 is the key
and item2 is the value that it maps to")
you don't need another patch for that, so sr=alecf with that comment :)
Assignee | ||
Comment 20•24 years ago
|
||
Fixed checked in.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•24 years ago
|
Whiteboard: [w]
You need to log in
before you can comment on or make changes to this bug.
Description
•