<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[211589] trunk/Source</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/211589">211589</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2017-02-02 13:24:11 -0800 (Thu, 02 Feb 2017)</dd>
</dl>
<h3>Log Message</h3>
<pre>Unreviewed, rolling out <a href="http://trac.webkit.org/projects/webkit/changeset/211571">r211571</a> and <a href="http://trac.webkit.org/projects/webkit/changeset/211582">r211582</a>.
https://bugs.webkit.org/show_bug.cgi?id=167751
This change caused API test WebKit1.MemoryPressureHandler to
fail with an assertion. (Requested by ryanhaddad on #webkit).
Reverted changesets:
"[Mac] In-process memory pressure monitor for WebContent
processes."
https://bugs.webkit.org/show_bug.cgi?id=167491
http://trac.webkit.org/changeset/211571
"Unreviewed attempt to fix the Windows build after <a href="http://trac.webkit.org/projects/webkit/changeset/211571">r211571</a>."
http://trac.webkit.org/changeset/211582</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapHeapcpp">trunk/Source/JavaScriptCore/heap/Heap.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreheapHeaph">trunk/Source/JavaScriptCore/heap/Heap.h</a></li>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFWTFxcodeprojprojectpbxproj">trunk/Source/WTF/WTF.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWTFwtfCMakeListstxt">trunk/Source/WTF/wtf/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsjsCommonVMcpp">trunk/Source/WebCore/bindings/js/CommonVM.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderFrameLoadercpp">trunk/Source/WebCore/loader/FrameLoader.cpp</a></li>
<li><a href="#trunkSourceWebCorepageMainFramecpp">trunk/Source/WebCore/page/MainFrame.cpp</a></li>
<li><a href="#trunkSourceWebCorepageMainFrameh">trunk/Source/WebCore/page/MainFrame.h</a></li>
<li><a href="#trunkSourceWebCorepageMemoryReleasecpp">trunk/Source/WebCore/page/MemoryRelease.cpp</a></li>
<li><a href="#trunkSourceWebCorepageMemoryReleaseh">trunk/Source/WebCore/page/MemoryRelease.h</a></li>
<li><a href="#trunkSourceWebCorepageResourceUsageThreadh">trunk/Source/WebCore/page/ResourceUsageThread.h</a></li>
<li><a href="#trunkSourceWebCorepagecocoaResourceUsageThreadCocoamm">trunk/Source/WebCore/page/cocoa/ResourceUsageThreadCocoa.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformMemoryPressureHandlercpp">trunk/Source/WebCore/platform/MemoryPressureHandler.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformMemoryPressureHandlerh">trunk/Source/WebCore/platform/MemoryPressureHandler.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebProcesscpp">trunk/Source/WebKit2/WebProcess/WebProcess.cpp</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWTFwtfMemoryFootprintcpp">trunk/Source/WTF/wtf/MemoryFootprint.cpp</a></li>
<li><a href="#trunkSourceWTFwtfMemoryFootprinth">trunk/Source/WTF/wtf/MemoryFootprint.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (211588 => 211589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2017-02-02 21:05:17 UTC (rev 211588)
+++ trunk/Source/JavaScriptCore/ChangeLog        2017-02-02 21:24:11 UTC (rev 211589)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2017-02-02 Commit Queue <commit-queue@webkit.org>
+
+ Unreviewed, rolling out r211571 and r211582.
+ https://bugs.webkit.org/show_bug.cgi?id=167751
+
+ This change caused API test WebKit1.MemoryPressureHandler to
+ fail with an assertion. (Requested by ryanhaddad on #webkit).
+
+ Reverted changesets:
+
+ "[Mac] In-process memory pressure monitor for WebContent
+ processes."
+ https://bugs.webkit.org/show_bug.cgi?id=167491
+ http://trac.webkit.org/changeset/211571
+
+ "Unreviewed attempt to fix the Windows build after r211571."
+ http://trac.webkit.org/changeset/211582
+
</ins><span class="cx"> 2017-02-02 Andreas Kling <akling@apple.com>
</span><span class="cx">
</span><span class="cx"> [Mac] In-process memory pressure monitor for WebContent processes.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapHeapcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/Heap.cpp (211588 => 211589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/Heap.cpp        2017-02-02 21:05:17 UTC (rev 211588)
+++ trunk/Source/JavaScriptCore/heap/Heap.cpp        2017-02-02 21:24:11 UTC (rev 211589)
</span><span class="lines">@@ -1726,6 +1726,11 @@
</span><span class="cx"> m_sweeper->startSweeping();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+NEVER_INLINE void Heap::didExceedMaxLiveSize()
+{
+ CRASH();
+}
+
</ins><span class="cx"> void Heap::updateAllocationLimits()
</span><span class="cx"> {
</span><span class="cx"> static const bool verbose = false;
</span><span class="lines">@@ -1757,6 +1762,9 @@
</span><span class="cx">
</span><span class="cx"> if (verbose)
</span><span class="cx"> dataLog("extraMemorySize() = ", extraMemorySize(), ", currentHeapSize = ", currentHeapSize, "\n");
</span><ins>+
+ if (m_maxLiveSize && currentHeapSize > m_maxLiveSize)
+ didExceedMaxLiveSize();
</ins><span class="cx">
</span><span class="cx"> if (Options::gcMaxHeapSize() && currentHeapSize > Options::gcMaxHeapSize())
</span><span class="cx"> HeapStatistics::exitWithFailure();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreheapHeaph"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/heap/Heap.h (211588 => 211589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/heap/Heap.h        2017-02-02 21:05:17 UTC (rev 211588)
+++ trunk/Source/JavaScriptCore/heap/Heap.h        2017-02-02 21:24:11 UTC (rev 211589)
</span><span class="lines">@@ -132,6 +132,9 @@
</span><span class="cx">
</span><span class="cx"> VM* vm() const;
</span><span class="cx">
</span><ins>+ // Set a hard limit where JSC will crash if live heap size exceeds it.
+ void setMaxLiveSize(size_t size) { m_maxLiveSize = size; }
+
</ins><span class="cx"> MarkedSpace& objectSpace() { return m_objectSpace; }
</span><span class="cx"> MachineThreads& machineThreads() { return m_machineThreads; }
</span><span class="cx">
</span><span class="lines">@@ -600,6 +603,9 @@
</span><span class="cx"> size_t m_blockBytesAllocated { 0 };
</span><span class="cx"> size_t m_externalMemorySize { 0 };
</span><span class="cx"> #endif
</span><ins>+
+ NO_RETURN_DUE_TO_CRASH void didExceedMaxLiveSize();
+ size_t m_maxLiveSize { 0 };
</ins><span class="cx">
</span><span class="cx"> std::unique_ptr<MutatorScheduler> m_scheduler;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (211588 => 211589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog        2017-02-02 21:05:17 UTC (rev 211588)
+++ trunk/Source/WTF/ChangeLog        2017-02-02 21:24:11 UTC (rev 211589)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2017-02-02 Commit Queue <commit-queue@webkit.org>
+
+ Unreviewed, rolling out r211571 and r211582.
+ https://bugs.webkit.org/show_bug.cgi?id=167751
+
+ This change caused API test WebKit1.MemoryPressureHandler to
+ fail with an assertion. (Requested by ryanhaddad on #webkit).
+
+ Reverted changesets:
+
+ "[Mac] In-process memory pressure monitor for WebContent
+ processes."
+ https://bugs.webkit.org/show_bug.cgi?id=167491
+ http://trac.webkit.org/changeset/211571
+
+ "Unreviewed attempt to fix the Windows build after r211571."
+ http://trac.webkit.org/changeset/211582
+
</ins><span class="cx"> 2017-02-02 Andreas Kling <akling@apple.com>
</span><span class="cx">
</span><span class="cx"> [Mac] In-process memory pressure monitor for WebContent processes.
</span></span></pre></div>
<a id="trunkSourceWTFWTFxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/WTF.xcodeproj/project.pbxproj (211588 => 211589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/WTF.xcodeproj/project.pbxproj        2017-02-02 21:05:17 UTC (rev 211588)
+++ trunk/Source/WTF/WTF.xcodeproj/project.pbxproj        2017-02-02 21:24:11 UTC (rev 211589)
</span><span class="lines">@@ -337,8 +337,6 @@
</span><span class="cx">                 A8A47487151A825B004123FF /* WTFThreadData.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4737B151A825B004123FF /* WTFThreadData.h */; };
</span><span class="cx">                 A8A4748C151A8264004123FF /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = A8A4748B151A8264004123FF /* config.h */; };
</span><span class="cx">                 AD7C434B1DD2A4A70026888B /* Expected.h in Headers */ = {isa = PBXBuildFile; fileRef = AD7C434A1DD2A4A70026888B /* Expected.h */; };
</span><del>-                ADF2CE661E39F106006889DB /* MemoryFootprint.h in Headers */ = {isa = PBXBuildFile; fileRef = ADF2CE641E39F106006889DB /* MemoryFootprint.h */; settings = {ATTRIBUTES = (Private, ); }; };
-                ADF2CE671E39F106006889DB /* MemoryFootprint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ADF2CE651E39F106006889DB /* MemoryFootprint.cpp */; };
</del><span class="cx">                 B38FD7BD168953E80065C969 /* FeatureDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = B38FD7BC168953E80065C969 /* FeatureDefines.h */; };
</span><span class="cx">                 C4F8A93719C65EB400B2B15D /* Stopwatch.h in Headers */ = {isa = PBXBuildFile; fileRef = C4F8A93619C65EB400B2B15D /* Stopwatch.h */; };
</span><span class="cx">                 C8B0E1A1E01A486EB95E0D11 /* IndexSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 3137E1D7DBD84AC38FAE4D34 /* IndexSet.h */; };
</span><span class="lines">@@ -721,8 +719,6 @@
</span><span class="cx">                 A8A4737B151A825B004123FF /* WTFThreadData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WTFThreadData.h; sourceTree = "<group>"; };
</span><span class="cx">                 A8A4748B151A8264004123FF /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = "<group>"; };
</span><span class="cx">                 AD7C434A1DD2A4A70026888B /* Expected.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Expected.h; sourceTree = "<group>"; };
</span><del>-                ADF2CE641E39F106006889DB /* MemoryFootprint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryFootprint.h; sourceTree = "<group>"; };
-                ADF2CE651E39F106006889DB /* MemoryFootprint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MemoryFootprint.cpp; sourceTree = "<group>"; };
</del><span class="cx">                 B38FD7BC168953E80065C969 /* FeatureDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FeatureDefines.h; sourceTree = "<group>"; };
</span><span class="cx">                 C4F8A93619C65EB400B2B15D /* Stopwatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Stopwatch.h; sourceTree = "<group>"; };
</span><span class="cx">                 CD5497AA15857D0300B5BC30 /* MediaTime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MediaTime.cpp; sourceTree = "<group>"; };
</span><span class="lines">@@ -1009,8 +1005,6 @@
</span><span class="cx">                                 A8A472CB151A825B004123FF /* MD5.h */,
</span><span class="cx">                                 CD5497AA15857D0300B5BC30 /* MediaTime.cpp */,
</span><span class="cx">                                 CD5497AB15857D0300B5BC30 /* MediaTime.h */,
</span><del>-                                ADF2CE641E39F106006889DB /* MemoryFootprint.h */,
-                                ADF2CE651E39F106006889DB /* MemoryFootprint.cpp */,
</del><span class="cx">                                 A8A472CC151A825B004123FF /* MessageQueue.h */,
</span><span class="cx">                                 A8A472CD151A825B004123FF /* MetaAllocator.cpp */,
</span><span class="cx">                                 A8A472CE151A825B004123FF /* MetaAllocator.h */,
</span><span class="lines">@@ -1500,7 +1494,6 @@
</span><span class="cx">                                 A8A4741C151A825B004123FF /* RefPtr.h in Headers */,
</span><span class="cx">                                 A8A4741E151A825B004123FF /* RetainPtr.h in Headers */,
</span><span class="cx">                                 2CDED0F418115C85004DBA70 /* RunLoop.h in Headers */,
</span><del>-                                ADF2CE661E39F106006889DB /* MemoryFootprint.h in Headers */,
</del><span class="cx">                                 1469419216EAAF6D0024E146 /* RunLoopTimer.h in Headers */,
</span><span class="cx">                                 A5098B001C169E0700087797 /* SandboxSPI.h in Headers */,
</span><span class="cx">                                 14F3B0F715E45E4600210069 /* SaturatedArithmetic.h in Headers */,
</span><span class="lines">@@ -1708,7 +1701,6 @@
</span><span class="cx">                                 1ACADD841884480100D8B71D /* DeprecatedSymbolsUsedBySafari.mm in Sources */,
</span><span class="cx">                                 A8A473AE151A825B004123FF /* diy-fp.cc in Sources */,
</span><span class="cx">                                 A8A473B0151A825B004123FF /* double-conversion.cc in Sources */,
</span><del>-                                ADF2CE671E39F106006889DB /* MemoryFootprint.cpp in Sources */,
</del><span class="cx">                                 A8A473BA151A825B004123FF /* dtoa.cpp in Sources */,
</span><span class="cx">                                 A8A473B3151A825B004123FF /* fast-dtoa.cc in Sources */,
</span><span class="cx">                                 0F7C5FB61D885CF20044F5E2 /* FastBitVector.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWTFwtfCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/CMakeLists.txt (211588 => 211589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/CMakeLists.txt        2017-02-02 21:05:17 UTC (rev 211588)
+++ trunk/Source/WTF/wtf/CMakeLists.txt        2017-02-02 21:24:11 UTC (rev 211589)
</span><span class="lines">@@ -64,7 +64,6 @@
</span><span class="cx"> MallocPtr.h
</span><span class="cx"> MathExtras.h
</span><span class="cx"> MediaTime.h
</span><del>- MemoryFootprint.h
</del><span class="cx"> MessageQueue.h
</span><span class="cx"> MetaAllocator.h
</span><span class="cx"> MetaAllocatorHandle.h
</span><span class="lines">@@ -205,7 +204,6 @@
</span><span class="cx"> MD5.cpp
</span><span class="cx"> MainThread.cpp
</span><span class="cx"> MediaTime.cpp
</span><del>- MemoryFootprint.cpp
</del><span class="cx"> MetaAllocator.cpp
</span><span class="cx"> MonotonicTime.cpp
</span><span class="cx"> NumberOfCores.cpp
</span></span></pre></div>
<a id="trunkSourceWTFwtfMemoryFootprintcpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WTF/wtf/MemoryFootprint.cpp (211588 => 211589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/MemoryFootprint.cpp        2017-02-02 21:05:17 UTC (rev 211588)
+++ trunk/Source/WTF/wtf/MemoryFootprint.cpp        2017-02-02 21:24:11 UTC (rev 211589)
</span><span class="lines">@@ -1,50 +0,0 @@
</span><del>-/*
- * Copyright (C) 2017 Apple Inc. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "MemoryFootprint.h"
-
-#if PLATFORM(COCOA)
-#include <mach/mach.h>
-#include <mach/task_info.h>
-#endif
-
-namespace WTF {
-
-std::optional<size_t> memoryFootprint()
-{
-#if PLATFORM(COCOA)
- task_vm_info_data_t vmInfo;
- mach_msg_type_number_t count = TASK_VM_INFO_COUNT;
- kern_return_t result = task_info(mach_task_self(), TASK_VM_INFO, (task_info_t) &vmInfo, &count);
- if (result != KERN_SUCCESS)
- return std::nullopt;
- return static_cast<size_t>(vmInfo.phys_footprint);
-#else
- return std::nullopt;
-#endif
-}
-
-}
</del></span></pre></div>
<a id="trunkSourceWTFwtfMemoryFootprinth"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WTF/wtf/MemoryFootprint.h (211588 => 211589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/MemoryFootprint.h        2017-02-02 21:05:17 UTC (rev 211588)
+++ trunk/Source/WTF/wtf/MemoryFootprint.h        2017-02-02 21:24:11 UTC (rev 211589)
</span><span class="lines">@@ -1,37 +0,0 @@
</span><del>-/*
- * Copyright (C) 2017 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#pragma once
-
-#include <wtf/Optional.h>
-
-namespace WTF {
-
-WTF_EXPORT_PRIVATE std::optional<size_t> memoryFootprint();
-
-}
-
-using WTF::memoryFootprint;
-
</del></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (211588 => 211589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-02-02 21:05:17 UTC (rev 211588)
+++ trunk/Source/WebCore/ChangeLog        2017-02-02 21:24:11 UTC (rev 211589)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2017-02-02 Commit Queue <commit-queue@webkit.org>
+
+ Unreviewed, rolling out r211571 and r211582.
+ https://bugs.webkit.org/show_bug.cgi?id=167751
+
+ This change caused API test WebKit1.MemoryPressureHandler to
+ fail with an assertion. (Requested by ryanhaddad on #webkit).
+
+ Reverted changesets:
+
+ "[Mac] In-process memory pressure monitor for WebContent
+ processes."
+ https://bugs.webkit.org/show_bug.cgi?id=167491
+ http://trac.webkit.org/changeset/211571
+
+ "Unreviewed attempt to fix the Windows build after r211571."
+ http://trac.webkit.org/changeset/211582
+
</ins><span class="cx"> 2017-02-02 Chris Dumez <cdumez@apple.com>
</span><span class="cx">
</span><span class="cx"> Unreviewed attempt to fix the Windows build after r211571.
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsCommonVMcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/CommonVM.cpp (211588 => 211589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/CommonVM.cpp        2017-02-02 21:05:17 UTC (rev 211588)
+++ trunk/Source/WebCore/bindings/js/CommonVM.cpp        2017-02-02 21:24:11 UTC (rev 211589)
</span><span class="lines">@@ -46,6 +46,10 @@
</span><span class="cx">
</span><span class="cx"> ScriptController::initializeThreading();
</span><span class="cx"> g_commonVMOrNull = &VM::createLeaked(LargeHeap).leakRef();
</span><ins>+#if CPU(X86_64) || CPU(ARM64)
+ static const size_t maxGCHeapSize = 4 * GB;
+ g_commonVMOrNull->heap.setMaxLiveSize(maxGCHeapSize);
+#endif
</ins><span class="cx"> g_commonVMOrNull->heap.acquireAccess(); // At any time, we may do things that affect the GC.
</span><span class="cx"> #if !PLATFORM(IOS)
</span><span class="cx"> g_commonVMOrNull->setExclusiveThread(std::this_thread::get_id());
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderFrameLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/FrameLoader.cpp (211588 => 211589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/FrameLoader.cpp        2017-02-02 21:05:17 UTC (rev 211588)
+++ trunk/Source/WebCore/loader/FrameLoader.cpp        2017-02-02 21:24:11 UTC (rev 211589)
</span><span class="lines">@@ -1742,7 +1742,7 @@
</span><span class="cx"> if (m_documentLoader)
</span><span class="cx"> m_documentLoader->stopRecordingResponses();
</span><span class="cx"> if (m_frame.isMainFrame() && oldState != newState)
</span><del>- static_cast<MainFrame&>(m_frame).didCompleteLoad();
</del><ins>+ static_cast<MainFrame&>(m_frame).performanceLogging().didReachPointOfInterest(PerformanceLogging::MainFrameLoadCompleted);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorepageMainFramecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/MainFrame.cpp (211588 => 211589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/MainFrame.cpp        2017-02-02 21:05:17 UTC (rev 211588)
+++ trunk/Source/WebCore/page/MainFrame.cpp        2017-02-02 21:24:11 UTC (rev 211589)
</span><span class="lines">@@ -95,12 +95,6 @@
</span><span class="cx"> tree().removeChild(*child);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void MainFrame::didCompleteLoad()
-{
- m_timeOfLastCompletedLoad = MonotonicTime::now();
- performanceLogging().didReachPointOfInterest(PerformanceLogging::MainFrameLoadCompleted);
-}
-
</del><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx"> ScrollLatchingState* MainFrame::latchingState()
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCorepageMainFrameh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/MainFrame.h (211588 => 211589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/MainFrame.h        2017-02-02 21:05:17 UTC (rev 211588)
+++ trunk/Source/WebCore/page/MainFrame.h        2017-02-02 21:24:11 UTC (rev 211589)
</span><span class="lines">@@ -69,9 +69,6 @@
</span><span class="cx">
</span><span class="cx"> PerformanceLogging& performanceLogging() const { return *m_performanceLogging; }
</span><span class="cx">
</span><del>- void didCompleteLoad();
- MonotonicTime timeOfLastCompletedLoad() const { return m_timeOfLastCompletedLoad; }
-
</del><span class="cx"> private:
</span><span class="cx"> MainFrame(Page&, PageConfiguration&);
</span><span class="cx">
</span><span class="lines">@@ -94,8 +91,6 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> std::unique_ptr<PerformanceLogging> m_performanceLogging;
</span><del>-
- MonotonicTime m_timeOfLastCompletedLoad;
</del><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorepageMemoryReleasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/MemoryRelease.cpp (211588 => 211589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/MemoryRelease.cpp        2017-02-02 21:05:17 UTC (rev 211588)
+++ trunk/Source/WebCore/page/MemoryRelease.cpp        2017-02-02 21:24:11 UTC (rev 211589)
</span><span class="lines">@@ -29,7 +29,6 @@
</span><span class="cx"> #include "CSSValuePool.h"
</span><span class="cx"> #include "Chrome.h"
</span><span class="cx"> #include "ChromeClient.h"
</span><del>-#include "CommonVM.h"
</del><span class="cx"> #include "Document.h"
</span><span class="cx"> #include "FontCache.h"
</span><span class="cx"> #include "GCController.h"
</span><span class="lines">@@ -36,8 +35,6 @@
</span><span class="cx"> #include "HTMLMediaElement.h"
</span><span class="cx"> #include "InlineStyleSheetOwner.h"
</span><span class="cx"> #include "InspectorInstrumentation.h"
</span><del>-#include "Logging.h"
-#include "MainFrame.h"
</del><span class="cx"> #include "MemoryCache.h"
</span><span class="cx"> #include "Page.h"
</span><span class="cx"> #include "PageCache.h"
</span><span class="lines">@@ -48,10 +45,6 @@
</span><span class="cx"> #include "WorkerThread.h"
</span><span class="cx"> #include <wtf/FastMalloc.h>
</span><span class="cx">
</span><del>-#if PLATFORM(COCOA)
-#include "ResourceUsageThread.h"
-#endif
-
</del><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> static void releaseNoncriticalMemory()
</span><span class="lines">@@ -135,88 +128,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">
</span><del>-#if !RELEASE_LOG_DISABLED
-static unsigned pageCount()
-{
- unsigned count = 0;
- Page::forEachPage([&] (Page& page) {
- if (!page.isUtilityPage())
- ++count;
- });
- return count;
-}
-#endif
-
-void logMemoryStatisticsAtTimeOfDeath()
-{
-#if !RELEASE_LOG_DISABLED
-#if PLATFORM(COCOA)
- auto pageSize = vmPageSize();
- auto pages = pagesPerVMTag();
-
- RELEASE_LOG(MemoryPressure, "Dirty memory per VM tag at time of death:");
- for (unsigned i = 0; i < 256; ++i) {
- size_t dirty = pages[i].dirty * pageSize;
- if (!dirty)
- continue;
- String tagName = displayNameForVMTag(i);
- if (!tagName)
- tagName = String::format("Tag %u", i);
- RELEASE_LOG(MemoryPressure, "%16s: %lu MB", tagName.latin1().data(), dirty / MB);
- }
-#endif
-
- auto& vm = commonVM();
- RELEASE_LOG(MemoryPressure, "Memory usage statistics at time of death:");
- RELEASE_LOG(MemoryPressure, "GC heap size: %zu", vm.heap.size());
- RELEASE_LOG(MemoryPressure, "GC heap extra memory size: %zu", vm.heap.extraMemorySize());
-#if ENABLE(RESOURCE_USAGE)
- RELEASE_LOG(MemoryPressure, "GC heap external memory: %zu", vm.heap.externalMemorySize());
-#endif
- RELEASE_LOG(MemoryPressure, "Global object count: %zu", vm.heap.globalObjectCount());
-
- RELEASE_LOG(MemoryPressure, "Page count: %u", pageCount());
- RELEASE_LOG(MemoryPressure, "Document count: %u", Document::allDocuments().size());
- RELEASE_LOG(MemoryPressure, "Live JavaScript objects:");
- for (auto& it : *vm.heap.objectTypeCounts())
- RELEASE_LOG(MemoryPressure, " %s: %d", it.key, it.value);
-#endif
-}
-
-void didExceedMemoryLimitAndFailedToRecover()
-{
- RELEASE_LOG(MemoryPressure, "Crashing non-visible process due to excessive memory usage + inability to free up memory below panic threshold.");
- logMemoryStatisticsAtTimeOfDeath();
- CRASH();
-}
-
-bool processIsEligibleForMemoryKill()
-{
- bool hasVisiblePages = false;
- bool hasAudiblePages = false;
- bool hasMainFrameNavigatedInTheLastHour = false;
-
- auto now = MonotonicTime::now();
- Page::forEachPage([&] (Page& page) {
- if (page.isUtilityPage())
- return;
- if (page.isVisible())
- hasVisiblePages = true;
- if (page.activityState() & ActivityState::IsAudible)
- hasAudiblePages = true;
- if (auto timeOfLastCompletedLoad = page.mainFrame().timeOfLastCompletedLoad()) {
- if (now - timeOfLastCompletedLoad <= Seconds::fromMinutes(60))
- hasMainFrameNavigatedInTheLastHour = true;
- }
- });
-
- bool eligible = !hasVisiblePages && !hasAudiblePages && !hasMainFrameNavigatedInTheLastHour;
- if (!eligible)
- RELEASE_LOG(MemoryPressure, "Process not eligible for panic memory kill. Reasons: hasVisiblePages=%u, hasAudiblePages=%u, hasMainFrameNavigatedInTheLastHour=%u", hasVisiblePages, hasAudiblePages, hasMainFrameNavigatedInTheLastHour);
-
- return eligible;
-}
-
</del><span class="cx"> #if !PLATFORM(COCOA)
</span><span class="cx"> void platformReleaseMemory(Critical) { }
</span><span class="cx"> void jettisonExpensiveObjectsOnTopLevelNavigation() { }
</span></span></pre></div>
<a id="trunkSourceWebCorepageMemoryReleaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/MemoryRelease.h (211588 => 211589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/MemoryRelease.h        2017-02-02 21:05:17 UTC (rev 211588)
+++ trunk/Source/WebCore/page/MemoryRelease.h        2017-02-02 21:24:11 UTC (rev 211589)
</span><span class="lines">@@ -33,8 +33,5 @@
</span><span class="cx"> void platformReleaseMemory(Critical);
</span><span class="cx"> void jettisonExpensiveObjectsOnTopLevelNavigation();
</span><span class="cx"> WEBCORE_EXPORT void registerMemoryReleaseNotifyCallbacks();
</span><del>-WEBCORE_EXPORT void logMemoryStatisticsAtTimeOfDeath();
-WEBCORE_EXPORT NO_RETURN_DUE_TO_CRASH void didExceedMemoryLimitAndFailedToRecover();
-WEBCORE_EXPORT bool processIsEligibleForMemoryKill();
</del><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorepageResourceUsageThreadh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/ResourceUsageThread.h (211588 => 211589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/ResourceUsageThread.h        2017-02-02 21:05:17 UTC (rev 211588)
+++ trunk/Source/WebCore/page/ResourceUsageThread.h        2017-02-02 21:24:11 UTC (rev 211589)
</span><span class="lines">@@ -80,7 +80,6 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> const char* displayNameForVMTag(unsigned);
</span><del>-size_t vmPageSize();
</del><span class="cx"> std::array<TagInfo, 256> pagesPerVMTag();
</span><span class="cx"> void logFootprintComparison(const std::array<TagInfo, 256>&, const std::array<TagInfo, 256>&);
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorepagecocoaResourceUsageThreadCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/cocoa/ResourceUsageThreadCocoa.mm (211588 => 211589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/cocoa/ResourceUsageThreadCocoa.mm        2017-02-02 21:05:17 UTC (rev 211588)
+++ trunk/Source/WebCore/page/cocoa/ResourceUsageThreadCocoa.mm        2017-02-02 21:24:11 UTC (rev 211589)
</span><span class="lines">@@ -37,7 +37,7 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-size_t vmPageSize()
</del><ins>+static size_t vmPageSize()
</ins><span class="cx"> {
</span><span class="cx"> #if PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000
</span><span class="cx"> return vm_kernel_page_size;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformMemoryPressureHandlercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/MemoryPressureHandler.cpp (211588 => 211589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/MemoryPressureHandler.cpp        2017-02-02 21:05:17 UTC (rev 211588)
+++ trunk/Source/WebCore/platform/MemoryPressureHandler.cpp        2017-02-02 21:24:11 UTC (rev 211589)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2011-2017 Apple Inc. All Rights Reserved.
</del><ins>+ * Copyright (C) 2011, 2014 Apple Inc. All Rights Reserved.
</ins><span class="cx"> *
</span><span class="cx"> * Redistribution and use in source and binary forms, with or without
</span><span class="cx"> * modification, are permitted provided that the following conditions
</span><span class="lines">@@ -27,7 +27,6 @@
</span><span class="cx"> #include "MemoryPressureHandler.h"
</span><span class="cx">
</span><span class="cx"> #include "Logging.h"
</span><del>-#include <wtf/MemoryFootprint.h>
</del><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="lines">@@ -40,123 +39,12 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> MemoryPressureHandler::MemoryPressureHandler()
</span><del>- : m_measurementTimer(RunLoop::main(), this, &MemoryPressureHandler::measurementTimerFired)
</del><span class="cx"> #if OS(LINUX)
</span><del>- , m_holdOffTimer(RunLoop::main(), this, &MemoryPressureHandler::holdOffTimerFired)
</del><ins>+ : m_holdOffTimer(RunLoop::main(), this, &MemoryPressureHandler::holdOffTimerFired)
</ins><span class="cx"> #endif
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void MemoryPressureHandler::setShouldUsePeriodicMemoryMonitor(bool use)
-{
- if (use)
- m_measurementTimer.startRepeating(30);
- else
- m_measurementTimer.stop();
-}
-
-#if !RELEASE_LOG_DISABLED
-static const char* toString(MemoryUsagePolicy policy)
-{
- switch (policy) {
- case MemoryUsagePolicy::Unrestricted: return "Unrestricted";
- case MemoryUsagePolicy::Conservative: return "Conservative";
- case MemoryUsagePolicy::Strict: return "Strict";
- case MemoryUsagePolicy::Panic: return "Panic";
- }
-}
-#endif
-
-static inline size_t thresholdForPolicy(MemoryUsagePolicy policy)
-{
- switch (policy) {
- case MemoryUsagePolicy::Conservative:
- return 1 * GB;
- case MemoryUsagePolicy::Strict:
- return 2 * GB;
- case MemoryUsagePolicy::Panic:
-#if CPU(X86_64) || CPU(ARM64)
- return 4 * GB;
-#else
- return 3 * GB;
-#endif
- case MemoryUsagePolicy::Unrestricted:
- default:
- ASSERT_NOT_REACHED();
- return 0;
- }
-}
-
-static inline MemoryUsagePolicy policyForFootprint(size_t footprint)
-{
- if (footprint >= thresholdForPolicy(MemoryUsagePolicy::Panic))
- return MemoryUsagePolicy::Panic;
- if (footprint >= thresholdForPolicy(MemoryUsagePolicy::Strict))
- return MemoryUsagePolicy::Strict;
- if (footprint >= thresholdForPolicy(MemoryUsagePolicy::Conservative))
- return MemoryUsagePolicy::Conservative;
- return MemoryUsagePolicy::Unrestricted;
-}
-
-void MemoryPressureHandler::measurementTimerFired()
-{
- auto footprint = memoryFootprint();
- if (!footprint)
- return;
-
- RELEASE_LOG(MemoryPressure, "Current memory footprint: %lu MB", footprint.value() / MB);
-
- auto newPolicy = policyForFootprint(footprint.value());
- if (newPolicy == m_memoryUsagePolicy) {
- if (m_memoryUsagePolicy != MemoryUsagePolicy::Panic)
- return;
- RELEASE_LOG(MemoryPressure, "Memory usage still above panic threshold");
- } else
- RELEASE_LOG(MemoryPressure, "Memory usage policy changed: %s -> %s", toString(m_memoryUsagePolicy), toString(newPolicy));
-
- m_memoryUsagePolicy = newPolicy;
-
- if (newPolicy == MemoryUsagePolicy::Unrestricted)
- return;
-
- if (newPolicy == MemoryUsagePolicy::Conservative) {
- // FIXME: Implement this policy by choosing which caches should respect it, and hooking them up.
- return;
- }
-
- if (newPolicy == MemoryUsagePolicy::Strict) {
- RELEASE_LOG(MemoryPressure, "Attempting to reduce memory footprint by freeing less important objects.");
- releaseMemory(Critical::No, Synchronous::No);
- return;
- }
-
- RELEASE_ASSERT(newPolicy == MemoryUsagePolicy::Panic);
-
- RELEASE_LOG(MemoryPressure, "Attempting to reduce memory footprint by freeing more important objects.");
- if (m_processIsEligibleForMemoryKillCallback) {
- if (!m_processIsEligibleForMemoryKillCallback()) {
- releaseMemory(Critical::Yes, Synchronous::No);
- return;
- }
- }
-
- releaseMemory(Critical::Yes, Synchronous::Yes);
-
- // Remeasure footprint to see how well the pressure handler did.
- footprint = memoryFootprint();
- RELEASE_ASSERT(footprint);
-
- RELEASE_LOG(MemoryPressure, "New memory footprint: %lu MB", footprint.value() / MB);
- if (footprint.value() < thresholdForPolicy(MemoryUsagePolicy::Panic)) {
- m_memoryUsagePolicy = policyForFootprint(footprint.value());
- RELEASE_LOG(MemoryPressure, "Pressure reduced below panic threshold. New memory usage policy: %s", toString(m_memoryUsagePolicy));
- return;
- }
-
- if (m_memoryKillCallback)
- m_memoryKillCallback();
-}
-
</del><span class="cx"> void MemoryPressureHandler::beginSimulatedMemoryPressure()
</span><span class="cx"> {
</span><span class="cx"> m_isSimulatingMemoryPressure = true;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformMemoryPressureHandlerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/MemoryPressureHandler.h (211588 => 211589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/MemoryPressureHandler.h        2017-02-02 21:05:17 UTC (rev 211588)
+++ trunk/Source/WebCore/platform/MemoryPressureHandler.h        2017-02-02 21:24:11 UTC (rev 211589)
</span><span class="lines">@@ -34,16 +34,16 @@
</span><span class="cx"> #include <wtf/Forward.h>
</span><span class="cx"> #include <wtf/NeverDestroyed.h>
</span><span class="cx"> #include <wtf/Optional.h>
</span><del>-#include <wtf/RunLoop.h>
</del><span class="cx">
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> #include <wtf/Lock.h>
</span><span class="cx"> #include <wtf/ThreadingPrimitives.h>
</span><del>-#endif
-
</del><ins>+#elif OS(LINUX)
+#include <wtf/RunLoop.h>
</ins><span class="cx"> #if USE(GLIB)
</span><span class="cx"> #include <wtf/glib/GRefPtr.h>
</span><span class="cx"> #endif
</span><ins>+#endif
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="lines">@@ -55,13 +55,6 @@
</span><span class="cx"> };
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-enum class MemoryUsagePolicy {
- Unrestricted, // Allocate as much as you want
- Conservative, // Maybe you don't cache every single thing
- Strict, // Time to start pinching pennies for real
- Panic, // OH GOD WE'RE SINKING, THROW EVERYTHING OVERBOARD
-};
-
</del><span class="cx"> enum class Critical { No, Yes };
</span><span class="cx"> enum class Synchronous { No, Yes };
</span><span class="cx">
</span><span class="lines">@@ -75,24 +68,12 @@
</span><span class="cx">
</span><span class="cx"> WEBCORE_EXPORT void install();
</span><span class="cx">
</span><del>- WEBCORE_EXPORT void setShouldUsePeriodicMemoryMonitor(bool);
-
- void setMemoryKillCallback(WTF::Function<void()> function) { m_memoryKillCallback = WTFMove(function); }
- void setProcessIsEligibleForMemoryKillCallback(WTF::Function<bool()> function) { m_processIsEligibleForMemoryKillCallback = WTFMove(function); }
-
</del><span class="cx"> void setLowMemoryHandler(LowMemoryHandler&& handler)
</span><span class="cx"> {
</span><span class="cx"> m_lowMemoryHandler = WTFMove(handler);
</span><span class="cx"> }
</span><span class="cx">
</span><del>- bool isUnderMemoryPressure() const
- {
- return m_underMemoryPressure
-#if PLATFORM(MAC)
- || m_memoryUsagePolicy >= MemoryUsagePolicy::Strict
-#endif
- || m_isSimulatingMemoryPressure;
- }
</del><ins>+ bool isUnderMemoryPressure() const { return m_underMemoryPressure || m_isSimulatingMemoryPressure; }
</ins><span class="cx"> void setUnderMemoryPressure(bool b) { m_underMemoryPressure = b; }
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="lines">@@ -168,9 +149,6 @@
</span><span class="cx"> void respondToMemoryPressure(Critical, Synchronous = Synchronous::No);
</span><span class="cx"> void platformReleaseMemory(Critical);
</span><span class="cx">
</span><del>- NO_RETURN_DUE_TO_CRASH void didExceedMemoryLimitAndFailedToRecover();
- void measurementTimerFired();
-
</del><span class="cx"> #if OS(LINUX)
</span><span class="cx"> class EventFDPoller {
</span><span class="cx"> WTF_MAKE_NONCOPYABLE(EventFDPoller); WTF_MAKE_FAST_ALLOCATED;
</span><span class="lines">@@ -192,16 +170,12 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> bool m_installed { false };
</span><ins>+ time_t m_lastRespondTime { 0 };
</ins><span class="cx"> LowMemoryHandler m_lowMemoryHandler;
</span><span class="cx">
</span><span class="cx"> std::atomic<bool> m_underMemoryPressure;
</span><span class="cx"> bool m_isSimulatingMemoryPressure { false };
</span><span class="cx">
</span><del>- RunLoop::Timer<MemoryPressureHandler> m_measurementTimer;
- MemoryUsagePolicy m_memoryUsagePolicy { MemoryUsagePolicy::Unrestricted };
- WTF::Function<void()> m_memoryKillCallback;
- WTF::Function<bool()> m_processIsEligibleForMemoryKillCallback;
-
</del><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> // FIXME: Can we share more of this with OpenSource?
</span><span class="cx"> uint32_t m_memoryPressureReason { MemoryPressureReasonNone };
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (211588 => 211589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2017-02-02 21:05:17 UTC (rev 211588)
+++ trunk/Source/WebKit2/ChangeLog        2017-02-02 21:24:11 UTC (rev 211589)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2017-02-02 Commit Queue <commit-queue@webkit.org>
+
+ Unreviewed, rolling out r211571 and r211582.
+ https://bugs.webkit.org/show_bug.cgi?id=167751
+
+ This change caused API test WebKit1.MemoryPressureHandler to
+ fail with an assertion. (Requested by ryanhaddad on #webkit).
+
+ Reverted changesets:
+
+ "[Mac] In-process memory pressure monitor for WebContent
+ processes."
+ https://bugs.webkit.org/show_bug.cgi?id=167491
+ http://trac.webkit.org/changeset/211571
+
+ "Unreviewed attempt to fix the Windows build after r211571."
+ http://trac.webkit.org/changeset/211582
+
</ins><span class="cx"> 2017-02-02 Dan Bernstein <mitz@apple.com>
</span><span class="cx">
</span><span class="cx"> The Make Frameworks Symbolic Link build phase can end up creating a symlink inside the Frameworks subdirectory
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebProcesscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebProcess.cpp (211588 => 211589)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2017-02-02 21:05:17 UTC (rev 211588)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.cpp        2017-02-02 21:24:11 UTC (rev 211589)
</span><span class="lines">@@ -261,15 +261,6 @@
</span><span class="cx"> memoryPressureHandler.setLowMemoryHandler([] (Critical critical, Synchronous synchronous) {
</span><span class="cx"> WebCore::releaseMemory(critical, synchronous);
</span><span class="cx"> });
</span><del>-#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101200
- memoryPressureHandler.setShouldUsePeriodicMemoryMonitor(true);
- memoryPressureHandler.setMemoryKillCallback([] () {
- WebCore::didExceedMemoryLimitAndFailedToRecover();
- });
- memoryPressureHandler.setProcessIsEligibleForMemoryKillCallback([] () {
- return WebCore::processIsEligibleForMemoryKill();
- });
-#endif
</del><span class="cx"> memoryPressureHandler.install();
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>