Get to know MDN better
This feature is well established and works across many devices and browser versions. It’s been available across browsers since October 2017.
The grow() prototype method of the WebAssembly.Memory object increases the size of the memory instance by a specified number of WebAssembly pages.
The number of WebAssembly pages you want to grow the memory by (each one is 64KiB in size). For memories with an address type of "i64", this must be a BigInt value.
The previous size of the memory, in units of WebAssembly pages. For memories with an address type of "i64", this is a BigInt value.
The following example creates a new WebAssembly Memory instance with an initial size of 1 page (64KiB), and a maximum size of 10 pages (640KiB).
We can then grow the instance by one page like so:
Note the return value of grow() here is the previous number of WebAssembly pages.
For memories with an address type of "i64", pass a BigInt value to grow():
Every call to grow will detach any references to the old buffer, even for grow(0)! Detachment means that the ArrayBuffer's byteLength becomes zero, and it no longer has bytes accessible to JavaScript. Accessing the buffer property after calling grow, will yield an ArrayBuffer with the correct length.
For a shared Memory instance, the initial buffer (which would be a SharedArrayBuffer in such case) will not become detached, but rather its length will not be updated. Accesses to the buffer property after growing will yield a larger SharedArrayBuffer which may access a larger span of memory than the buffer from before growing the Memory. Every SharedArrayBuffer from the buffer property will all refer to the start of the same memory address range, and thus manipulate the same data.
| WebAssembly JavaScript Interface # dom-memory-grow |
Enable JavaScript to view this browser compatibility table.
This page was last modified on May 14, 2026 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.