Release the memoized wasm instance so its WebAssembly.Memory can be
garbage-collected. Memory.grow() is one-way, so once a large DEM decode
has grown the linear memory it stays at that high-water mark for the page
lifetime; without this, a consumer that decodes terrain on the main thread
and then tears it down (e.g. addEsriTerrain(...).remove() on the CDN /
useWorker:false path) can never reclaim that heap. After resetWasm(), the
next ensureWasm call re-instantiates a fresh Memory.
Terminal for any in-flight decode. Prefer the lease-aware releaseWasmLease
path (driven by LercDecoder.dispose()), which only resets once the last live
decoder is gone; call this directly only when you know no decode is running.
(The off-thread worker path reclaims differently — terminating the worker frees
its whole realm, heap included.)
Returns void
Nothing; the next ensureWasm call instantiates a fresh module.
Release the memoized wasm instance so its
WebAssembly.Memorycan be garbage-collected.Memory.grow()is one-way, so once a large DEM decode has grown the linear memory it stays at that high-water mark for the page lifetime; without this, a consumer that decodes terrain on the main thread and then tears it down (e.g.addEsriTerrain(...).remove()on the CDN /useWorker:falsepath) can never reclaim that heap. AfterresetWasm(), the nextensureWasmcall re-instantiates a freshMemory.Terminal for any in-flight decode. Prefer the lease-aware
releaseWasmLeasepath (driven byLercDecoder.dispose()), which only resets once the last live decoder is gone; call this directly only when you know no decode is running. (The off-thread worker path reclaims differently — terminating the worker frees its whole realm, heap included.)