Title: [200884] trunk/Source/_javascript_Core
Revision
200884
Author
[email protected]
Date
2016-05-13 14:24:34 -0700 (Fri, 13 May 2016)

Log 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.

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (200883 => 200884)


--- trunk/Source/_javascript_Core/ChangeLog	2016-05-13 21:22:45 UTC (rev 200883)
+++ trunk/Source/_javascript_Core/ChangeLog	2016-05-13 21:24:34 UTC (rev 200884)
@@ -1,3 +1,21 @@
+2016-05-13  Geoffrey Garen  <[email protected]>
+
+        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.
+
 2016-05-13  Mark Lam  <[email protected]>
 
         We should have one calleeSaveRegistersBuffer per VMEntryFrame, not one per VM.

Modified: trunk/Source/_javascript_Core/heap/WeakSet.cpp (200883 => 200884)


--- trunk/Source/_javascript_Core/heap/WeakSet.cpp	2016-05-13 21:22:45 UTC (rev 200883)
+++ trunk/Source/_javascript_Core/heap/WeakSet.cpp	2016-05-13 21:24:34 UTC (rev 200884)
@@ -46,6 +46,8 @@
 void WeakSet::sweep()
 {
     for (WeakBlock* block = m_blocks.head(); block;) {
+        heap()->sweepNextLogicallyEmptyWeakBlock();
+
         WeakBlock* nextBlock = block->next();
         block->sweep();
         if (block->isLogicallyEmptyButNotFree()) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to