mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-25 01:01:52 +00:00
Bug 894993 - 'SessionWorker takes lots of memory'. r=billm+khuey.
This commit is contained in:
parent
40cfac1eb1
commit
4db2bb9f11
@ -4262,9 +4262,10 @@ WorkerPrivate::GarbageCollectInternal(JSContext* aCx, bool aShrinking,
|
||||
{
|
||||
AssertIsOnWorkerThread();
|
||||
|
||||
if (aCollectChildren) {
|
||||
if (aShrinking || aCollectChildren) {
|
||||
JSRuntime* rt = JS_GetRuntime(aCx);
|
||||
JS::PrepareForFullGC(rt);
|
||||
|
||||
if (aShrinking) {
|
||||
JS::ShrinkingGC(rt, JS::gcreason::DOM_WORKER);
|
||||
}
|
||||
@ -4273,10 +4274,6 @@ WorkerPrivate::GarbageCollectInternal(JSContext* aCx, bool aShrinking,
|
||||
}
|
||||
}
|
||||
else {
|
||||
// If aCollectChildren is false then it means this collection request was
|
||||
// not generated by the main thread. At the moment only the periodic GC
|
||||
// timer can end up here, so rather than force a collection let the JS
|
||||
// engine decide if we need one.
|
||||
JS_MaybeGC(aCx);
|
||||
}
|
||||
|
||||
|
@ -206,6 +206,7 @@ JSRuntime::setGCMaxMallocBytes(size_t value)
|
||||
* mean that value.
|
||||
*/
|
||||
gcMaxMallocBytes = (ptrdiff_t(value) >= 0) ? value : size_t(-1) >> 1;
|
||||
resetGCMallocBytes();
|
||||
for (ZonesIter zone(this); !zone.done(); zone.next())
|
||||
zone->setGCMaxMallocBytes(value);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user