[Webkit-unassigned] [Bug 247984] References to iframes seem to not get garbage collected

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Nov 16 21:28:33 PST 2022


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

--- Comment #7 from Yusuke Suzuki <ysuzuki at apple.com> ---
<!DOCTYPE html>
<html lang="en">

<head>
    <button onclick="allocate_memory();">
        Allocate Memory
    </button>
    <p>Memory bytes: </p>
    <p id="memory_text">65536</p>
</head>

<script>
    let ctx = {
      memory: new WebAssembly.Memory({
        initial: 1,
      })
    };
    const bytesPerPage = 64 * 1024;
    function allocate_memory() {
        let memory = ctx.memory;
        memory.grow(1000);
        document.getElementById("memory_text").innerHTML = memory.buffer.byteLength;
    }
</script>

Yeah, allocate_memory function in the global variable, and it is capturing WebAssembly.Memory. So, so long as iframe is alive, then WebAssembly.Memory is also alive.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20221117/b5914f30/attachment.htm>


More information about the webkit-unassigned mailing list