0Pricing
WebAssembly (WASM) for High Performance Apps · Lesson

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

  1. Passing Complex Data Structures
  2. WASM Memory Model & Management
  3. Shared Memory & Atomics
  4. Growing & Managing Linear Memory
← Back to WebAssembly (WASM) for High Performance Apps