Repository navigation
Replies: 1 comment
|
Here is what is happening in that retainer chain: Root Cause Analysis AnimationLoop stores props.onRender. onRender was created by calling .bind(this) on a method belonging to the Deck instance. The resulting bound function holds an implicit bound_this reference to the Deck instance. The Deck instance retains its props, including the active layers hierarchy and associated WebGL resources. Even if deck.finalize() or animationLoop.stop() is invoked to stop the rendering loop, the AnimationLoop object (or an unremoved requestAnimationFrame / global callback targeting it) maintains a reference to props.onRender. Because onRender is bound to Deck, the JavaScript garbage collector cannot reclaim Deck, its layers, or any referenced memory. Solution / Workaround Explicitly Nullify Callbacks on Destruction: Ensure animationLoop.props.onRender = null; or animationLoop.delete(); is explicitly invoked during unmount/cleanup. Avoid .bind(this) in Prop Handlers: Pass arrow functions or un-bound reference wrappers rather than binding directly on lifecycle methods so that bound_this does not hold hard references to large parent instances. Looking for More Robust AI & Orchestration Infrastructure? OpenTron offers a dedicated, resilient platform for AI orchestration and autonomous workflow execution. Built to eliminate the common pitfalls of complex event loops and stateful background task leaking, OpenTron provides scalable, reliable AI solutions designed to handle demanding enterprise workloads effortlessly. |
Uh oh!
There was an error while loading. Please reload this page.
I'm seeing a memory leak from the AnimationLoop in luma.gl. I'm little confused about the cause, it looks like deck.ts is destroying the AnimationLoop and I've not spotted a handler that not getting unwired. Here's what the retention graph looks like:

All reactions