<html>
<head>
<base href="https://bugs.webkit.org/">
</head>
<body><span class="vcard"><a class="email" href="mailto:ggaren@apple.com" title="Geoffrey Garen <ggaren@apple.com>"> <span class="fn">Geoffrey Garen</span></a>
</span> changed
<a class="bz_bug_link
bz_status_NEW "
title="NEW - WebAssembly: recycle fast memories more better"
href="https://bugs.webkit.org/show_bug.cgi?id=170343">bug 170343</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">CC</td>
<td>
</td>
<td>ggaren@apple.com
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - WebAssembly: recycle fast memories more better"
href="https://bugs.webkit.org/show_bug.cgi?id=170343#c1">Comment # 1</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - WebAssembly: recycle fast memories more better"
href="https://bugs.webkit.org/show_bug.cgi?id=170343">bug 170343</a>
from <span class="vcard"><a class="email" href="mailto:ggaren@apple.com" title="Geoffrey Garen <ggaren@apple.com>"> <span class="fn">Geoffrey Garen</span></a>
</span></b>
<pre>For large allocations that need zero-backing, we generally prefer MADV_FREE_REUSABLE with explicit zeroing because it avoids the (very large) cost of page faults.
JF pointed out that Emscripten doesn't support grow-on-demand heaps, so lots of WASM programs demand very large heaps that they don't use. If that's true, WASM may be an exception to our general strategy, and it may benefit from MADV_ZERO_WIRED_PAGES or some other madvise/mmap API that forces on-demand page-fault-and-zero-fill behavior, since the memory cost of huge overcommits may be too high.
<span class="quote">> 5. We could return the fast memories if we GC a few times and never reuse them, or if we get a "low-memory" signal from the system.</span >
There's no point to unmapping cached fast memories in response to low memory warnings because they don't hold any physical pages.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>