Changeset 200884 in webkit


Ignore:
Timestamp:
May 13, 2016, 2:24:34 PM (9 years ago)
Author:
ggaren@apple.com
Message:

Runaway malloc memory usage in this simple JSC program
https://bugs.webkit.org/show_bug.cgi?id=157682

Reviewed by Mark Lam.

  • heap/WeakSet.cpp:

(JSC::WeakSet::sweep): Whenever we might add a block to
m_logicallyEmptyWeakBlocks, be sure also to sweep a block in
m_logicallyEmptyWeakBlocks. Otherwise, additions might outpace removals
even when all memory is freed.

We do this whenever we *might* add a block and not just whenever we *do*
add a block because we'd like to sweep the entries in
m_logicallyEmptyWeakBlocks promptly even when it's not growing, and this
is a reasonably rate-limited opportunity to do so.

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r200879 r200884  
     12016-05-13  Geoffrey Garen  <ggaren@apple.com>
     2
     3        Runaway malloc memory usage in this simple JSC program
     4        https://bugs.webkit.org/show_bug.cgi?id=157682
     5
     6        Reviewed by Mark Lam.
     7
     8        * heap/WeakSet.cpp:
     9        (JSC::WeakSet::sweep): Whenever we might add a block to
     10        m_logicallyEmptyWeakBlocks, be sure also to sweep a block in
     11        m_logicallyEmptyWeakBlocks. Otherwise, additions might outpace removals
     12        even when all memory is freed.
     13
     14        We do this whenever we *might* add a block and not just whenever we *do*
     15        add a block because we'd like to sweep the entries in
     16        m_logicallyEmptyWeakBlocks promptly even when it's not growing, and this
     17        is a reasonably rate-limited opportunity to do so.
     18
    1192016-05-13  Mark Lam  <mark.lam@apple.com>
    220
  • trunk/Source/JavaScriptCore/heap/WeakSet.cpp

    r191849 r200884  
    4747{
    4848    for (WeakBlock* block = m_blocks.head(); block;) {
     49        heap()->sweepNextLogicallyEmptyWeakBlock();
     50
    4951        WeakBlock* nextBlock = block->next();
    5052        block->sweep();
Note: See TracChangeset for help on using the changeset viewer.