yeah! it's a React application that does a kind of tiled mapping, so the big memory concerns are around mounting the external map lib, attaching event listeners, and then making sure it all clears when the component is unmounted.
stable event listener callback references were the first target, then I found event listeners were being reattached each render even if the callback reference was stable. I added logic to avoid setting listeners if one was already attached.
after that it was fighting re-renders. There's a directional indicator SVG widget, kind of like a compass rose but 3 dimensional. Once the zoom level passed a certain threshold the change wasn't noticeable, so reducing the precision of updated values helped there
Comments
But none of that actually mattered because the memory overload was logging failed network requests for map tiles that didn't exist