Feature Library

GPU memory ledger

0.63 GPU · 5.84 CPU ms
A still of the GPU memory ledger demo
Still
The live demo starts when it’s in view.Switch “Pool small buffers” on and watch Held fall to the data · add and remove things with the buttons

Every GPU byte counted where WebGPU makes it, by kind and owner, held against asked.

What it costs a frame

0.63 ms
5.84 ms
GPU
0.63 ms
CPU, median
5.84 ms
CPU, 95th pct
6.89 ms
Draw calls
1520
Weight
Heavy

Measured 3 November 2026 on RTX 4060 Laptop, 13th Gen Intel(R) Core(TM) i9-13900H, Chrome 156, 1920×1080 at 1×. 600 frames × 3 rounds, median kept. What ran: Measured with steady churn, pool on (uniforms, vertices, indices) and dispose events: 1,500 meshes (each its own geometry), four 1024² textures and two 1024² MSAA render targets; every half second 80 meshes leave and 80 arrive, every 2 s a texture is replaced and every 3 s a render target. The ledger panel updates four times a second, outside the frame. The cost is mostly the 1,500 draws: the ledger does nothing per frame, and HaTac measured the pool’s CPU per frame as no different past the noise. Phones: tiers are being measured next.

On every machine it was measured on
MachineGPU msCPU msCPU p95
RTX 4060 Laptop · 13th Gen Intel(R) Core(TM) i9-13900Hreference · measuring tool0.635.846.89
apple · Apple A19 Proin a browser tab · 16 November 20266.573.564.66
Intel Arc 140V (Xe2-LPG) · Intel Core Ultra 7 258Vin a browser tab · 15 November 20262.6912.924.6

Bars against one 16.7 ms frame. A browser-tab run is timed in a visible tab without the tool’s scripted input, so read it as close, not exact.

What it needs

Renders with
WebGPUNeeds WebGPU: current Chrome and Edge, Safari 26+, Firefox 141+ on Windows.
Your browser
Checking…Looking for WebGPU
Depends on
three.js 0.187.0No other packages

What it’s for

  1. Finding what fills VRAM
  2. Scenes with thousands of meshes
  3. Streaming worlds that load and unload
  4. Leaks after a round trip
  5. Memory budgets and perf gates

Pitfalls, in brief

  1. All three hook three r187 internals (each file names what it touches): the backend’s create calls, the node frame, Geometries.updateForRender, RenderObjects.createRenderObject and _renderObjects, a render object’s dispose listeners, Textures.updateTexture.
  2. “Held” is a model of Chrome’s Dawn on D3D12 (resources under 4 MB take the next power of two, at least 64 KB), measured on an NVIDIA card within 3 % of the GPU process’s own counter.
  3. Install order matters: the ledger, then the pool (given the ledger), then the leak fix, all after renderer.init() and before the first draw.
  4. A reused pool slice must be zeroed: three never writes a uniform that is still 0 (it writes what changed from its CPU copy, which starts at 0 as a new GPU buffer does).
  5. The pool’s uninstall() drops its pages: only once nothing pooled is drawn again.
4 more in brief
  1. Dropping a mesh whose material or geometry is shared leaks it in three: the shared material’s dispose listener holds its render object, and the render object holds the mesh.
  2. Three frees a pipeline when the last render object using it goes: keep one of each kind drawn (the demo’s “kit”) or the next one stalls on a compile.
  3. WebGPU only, by design: on three’s WebGL2 backend there is no device to hook, so the ledger counts nothing and poolSmallBuffers returns null. weakRenderObjects hooks three’s own render objects and works on both.
  4. Pooling changes no shader or layout, but a write past a slice would land in its neighbour’s: it is dropped and reported once, as WebGPU drops one past a buffer.
9 pitfalls in full, the hook-up guide, the module source and its tests come with the part.

Where it comes from

From HaTac. Fully custom code.

vrammemorybuffersuniform bufferspoolingleaksgarbage collectionthree internalswebgpu

Near it in the frame