You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When switching cameras, a small amount of memory is leaked. This is enough to get Safari to crash on an iPhone 13 Pro after enough switches (somewhere between 500 and 1,000) on a simple scene.
Recording from an iPhone
It crashes about halfway through, auto-reloads, then crashes again and refuses to reload. This is due to running out of memory.
Warning: the video and reproduction strobe a bit as it changes the camera 100 times per second to speed up the crash.
To run it on your phone, you'll need to pull the stackblitz down and run it locally (npm install then npm run dev), then open it on your phone via the local network.
Misc comments
With a more complex app, I am able to crash the app in ~10 camera switches with an empty EffectComposer. I can't work out exactly what is causing the increase in memory consumption in the more complex case.
I think this is due to the fact that for every camera/scene change, the useMemo call in EffectComposer creates a new instance without disposing the old one, thus keeping all of the textures for the passes around.
When switching cameras, a small amount of memory is leaked. This is enough to get Safari to crash on an iPhone 13 Pro after enough switches (somewhere between 500 and 1,000) on a simple scene.
Recording from an iPhone
It crashes about halfway through, auto-reloads, then crashes again and refuses to reload. This is due to running out of memory.
Warning: the video and reproduction strobe a bit as it changes the camera 100 times per second to speed up the crash.
RPReplay_Final1711087455.mov
Reproduction
Here's the reproduction: https://stackblitz.com/edit/vitejs-vite-khvsd4?file=src%2FApp.tsx
To run it on your phone, you'll need to pull the stackblitz down and run it locally (
npm install
thennpm run dev
), then open it on your phone via the local network.Misc comments
With a more complex app, I am able to crash the app in ~10 camera switches with an empty EffectComposer. I can't work out exactly what is causing the increase in memory consumption in the more complex case.
I think this is due to the fact that for every camera/scene change, the
useMemo
call inEffectComposer
creates a new instance without disposing the old one, thus keeping all of the textures for the passes around.react-postprocessing/src/EffectComposer.tsx
Lines 105 to 115 in 29fda1b
The text was updated successfully, but these errors were encountered: