Closed Bug 1438287 Opened 8 years ago Closed 7 years ago

Reduce the overhead of the xpti working set in content processes

Categories

(Core :: XPCOM, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bzbarsky, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [MemShrink:P1])

This is mentioned some in bug 1436250 comment 1 and bug 1436250 comment 6, but our xpt bits use some nontrivial per-process memory. If about:memory measures all of it, it's about .83MB. That's about 5% of heap-allocated memory for a just-about:blank content process. Obviously we can make this better by removing more xpidl interfaces. But fundamentally, isn't this information identical across all processes? Can we just have the parent process read it from the file once, stick it in some memory that we them map (readonly) into all child processes, and skip both allocating it in child processes and the work of reading it in? This is more complicated than removing xpidl bits, and of less value the less xpidl bits we have, so not sure about the tradeoffs here.
Bug 799658 and bug 685241 have some related discussion. (This ended up being avoided in B2G by the Nuwa zygote process forking stuff.)
I've started looking a little into what the data actually is, and how we could reduce it. njn took a look at this a few years ago (bug 1249174 for instance) so there's not likely to be anything too egregious. Most of the memory is arena allocated. There's 8-byte aligned arenas, which take up 589,824 bytes, and 1-byte aligned arenas (for strings) which take up 204,800 bytes. By my estimates, we could reduce the string data by about 35k by eliminating duplicates (ie the string "nsISupports" appears a bunch of times).
Whiteboard: [MemShrink]
Whiteboard: [MemShrink] → [MemShrink:P1]
This data is now all statically allocated and shared.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.