[Webkit-unassigned] [Bug 89111] Heap::shouldCollect() should return true when system memory is low

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jun 14 13:37:19 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=89111





--- Comment #4 from Yong Li <yoli at rim.com>  2012-06-14 13:37:19 PST ---
(In reply to comment #3)
> Is there a performance test that demonstrates an advantage to this change?
> 
> Just knowing that a system is low on physical memory is not sufficient cause to garbage collect. At the limit, you would garbage collect after every byte allocated, which is O(n^2). I don't think that's a good idea.
> 
> Perhaps we could incorporate system load when calculating m_bytesAllocatedLimit. I could make a clearer suggestion if I knew more about the problem you were trying to solve.

When system is under memory pressure, WebKit should shrink memory usage as quick as possible to avoid a crash due to malloc failure. I know there is memory pressure handler in WebCore/platform. However if webkit thread is busy in executing JS (very often), it probably cannot get a chance to do anything before the crash. So I'm trying to find a way to make GC happen as early as possible. Especially now the GC threshold can be as big as 32MB.

Yes it would be hurt performance. So how about using a min(m_bytesAllocatedLimit, smallHeapSize) when system memory is low?

> Perhaps we could incorporate system load when calculating m_bytesAllocatedLimit

This is a good idea. That will require ramSize() to dynamically report currently available system memory.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list