Loading…
Loading…
A colleague creates a new Pixi-based GameMap component — a map with 1000 unit sprites, rotation animation, resize. It works in tests. But QA: after 10 map switches the tab uses 2 GB of RAM. Walk the diff and find every place resources aren't released.
PixiJS runs on WebGL — direct access to the GPU. GPU memory isn't managed by the JavaScript garbage collector. If you didn't call `destroy()`, the memory stays allocated. Critical resources: - **Application** — WebGL context (browser limit ~16 per page). - **Textures** — GPU texture memory, can be tens of MB each. - **Sprites, Containers** — JS objects + WebGL buffers. - **Tickers** — keep-alive for closures. - **Event listeners** — window/document level. In React: **every useEffect without cleanup = guaranteed leak** on re-renders. Look at the code and find everything that isn't cleaned up.