Growing & Managing Linear Memory
Learn how WASM linear memory grows on demand, how to size it, and how to manage allocation safely from JavaScript and the module.
One Big Array
WASM stores all its data in a single, contiguous block called linear memory, exposed to JS as a growable ArrayBuffer.
Understanding how it grows and how to manage it is key to high-performance modules.
Memory Is Page-Based
Linear memory is measured in pages of 64 KiB each.
- 1 page = 65536 bytes
- Memory grows in whole pages, never partial
All lessons in this course
- Passing Complex Data Structures
- WASM Memory Model & Management
- Shared Memory & Atomics
- Growing & Managing Linear Memory