mozilla / memchaser

Firefox extension to chase the memory usage and garbage collector activity
https://wiki.mozilla.org/QA/Automation_Services/Projects/Addons/MemChaser
29 stars 23 forks source link

Bring the minimizeMemory() implementation up to date #193

Closed nmaier closed 10 years ago

nmaier commented 10 years ago

The toolkit (aboutMemory.js) implementation looks like this, these days:

function doMMU()
{
  Services.obs.notifyObservers(null, "child-mmu-request", null);
  gMgr.minimizeMemoryUsage(
  () => updateMainAndFooter("Memory minimization completed", HIDE_FOOTER));
}

While .minimizeMemoryUsage() is just the "3x memory-pressure notifications" dance in C++ at the moment, i.e. equivalent to what memchaser uses anyway, the child-mmu-request is the more interesting bit. Sending this notification will cause child processes to call .minimizeMemoryUsage(). And since there are child processes even on Desktop these days, e.g. the thumbnailer for about:home and "New e10s window" in Nightly, it would be good for memchaser to send the notification as well.

whimboo commented 10 years ago

Thanks Nils. We will try to get this into the 0.6 release.

whimboo commented 10 years ago

PR #196 has been fixed. Thanks!