Closed
Bug 905221
Opened 11 years ago
Closed 11 years ago
nsEventQueue slop because NewPage() allocates non-power-of-two sized event queue objects
Categories
(Core :: XPCOM, defect)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
mozilla26
People
(Reporter: cpeterson, Assigned: cpeterson)
Details
(Whiteboard: [MemShrink:P3][clownshoes])
Attachments
(1 file)
1.02 KB,
patch
|
benjamin
:
review+
|
Details | Diff | Splinter Review |
nsEventQueue uses a linked list of Page objects to pass pointers to nsThreads. A Page is a struct containing 251 pointers. Depending on sizeof(void*), a Page uses only 1004 or 2008 bytes of its heap block's actual 1024 or 2048 bytes before allocating the next Page. Also, one might ask whether 250 is a reasonable value for EVENTS_PER_PAGE. In my testing, most nsEventQueues have a high-water mark less than ~50 events. https://hg.mozilla.org/mozilla-central/file/4930fdea3efa/xpcom/threads/nsEventQueue.h#l63
Updated•11 years ago
|
Whiteboard: [MemShrink]
Comment 1•11 years ago
|
||
If you change it to 255, a static assertion that sizeof(Page) is a power of two would be great!
Updated•11 years ago
|
Whiteboard: [MemShrink] → [MemShrink:P3]
Assignee | ||
Comment 2•11 years ago
|
||
Increase nsEventQueue::EVENTS_PER_PAGE from 250 to 255 so sizeof(nsEventQueue::Page) will be a power of two to avoid heap allocation slop.
Assignee | ||
Comment 3•11 years ago
|
||
bsmedberg: btw, here are your original comments on EVENTS_PER_PAGE from 2006: https://bugzilla.mozilla.org/show_bug.cgi?id=326273#c54
Updated•11 years ago
|
Attachment #798703 -
Flags: review?(benjamin) → review+
Updated•11 years ago
|
Whiteboard: [MemShrink:P3] → [MemShrink:P3][clownshoes]
Assignee | ||
Comment 4•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/f43fed6391f7
status-firefox25:
--- → wontfix
status-firefox26:
--- → fixed
Comment 5•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/f43fed6391f7
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
You need to log in
before you can comment on or make changes to this bug.
Description
•