# Scene Start/Stop Memory Leak

**URL:** <https://phaser.discourse.group/t/scene-start-stop-memory-leak/15496>\
**Category:** Phaser 3\
**Created:** [October 3, 2025, 5:25pm UTC](https://phaser.discourse.group/t/scene-start-stop-memory-leak/15496 "2025-10-03T17:25:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![phaserIsCool](https://avatars.discourse-cdn.com/v4/letter/p/cab0a1/32.png) [@phaserIsCool](https://phaser.discourse.group/u/phaserIsCool)\
**Post date:** [October 3, 2025, 5:25pm UTC](https://phaser.discourse.group/t/scene-start-stop-memory-leak/15496/1 "2025-10-03T17:25:04Z")

</div>

**The concern**

I am experiencing a memory buildup whenever I switch back and forth between two scenes. I use Firefox DevTools memory snapshots to determine that the buildup happens. I am manually triggering garbage collection in my browser (about:memory) everytime I switch back and forth. I trigger it before taking the snapshots.

Each time I switch back and forth between two scenes, I gain around 8 MB. My assets in total are around 2.5MB.

**The code**

I am switching back and forth between some scenes, say SceneA, SceneB and SceneC.

`scene.start` is used for this, meaning the scene that starts gets stopped.

I have a PreloadScene that start SceneA. All assets are preloaded from the preloadscene. Nowhere else does asset loading happen.

In the scenes, I listen for the shutdown event to then null all properties directly on the scene object. The code works.

**The question**

What else can I do to ensure no memory leaks are happening?

Thank you

---

<div class="post-metadata">

**Author:** ![phaserIsCool](https://avatars.discourse-cdn.com/v4/letter/p/cab0a1/32.png) [@phaserIsCool](https://phaser.discourse.group/u/phaserIsCool)\
**Post date:** [October 3, 2025, 6:21pm UTC](https://phaser.discourse.group/t/scene-start-stop-memory-leak/15496/2 "2025-10-03T18:21:26Z")

</div>

I found the solution: Removing the stopped scene frees memory.  
Afterwards, the scene has to be re-added, so that it can be started again.

This way, 0 memory footprint. I trigger garbage-collection and snapshot shows constant 16MB after each scene switch.

Garbage-Collector is lazy though, but that’s probably by design
