google / model-viewer

Easily display interactive 3D models on the web and in AR!
https://modelviewer.dev
Apache License 2.0
6.88k stars 816 forks source link

Changing src reloads/crashes the page #1674

Closed TheDino000 closed 3 years ago

TheDino000 commented 3 years ago

Description

To test this behaviour I've used the example code from modelviewer.dev along with models from Smithsonians open gallery (https://3d.si.edu/explore). When changing the src property 3-4 times, the page reloads/crashes. I've downloaded models from modelviewer.dev to make sure it's not the models, but the page reloaded/crashed after 10-15 times of chaning the src. Keep chaning the src until it reloads. With other models (larger perhaps?) it happens very quickly (3-4 times). It doesn't happen on desktop, only on Android and iOS.

Edit: Watching RAM on PC makes me realize that Memory is going up every time I change the src. Which probably leads to out of memory on mobile.

Live Demo

https://www.deltareality.com/webar/smithsonian-gallery/ Open this on mobile device or Chrome inspection toolbar for mobile

Version

Browser Affected

OS

v-prgmr commented 3 years ago

@elalish any update on this? I am also facing the same issue where in the browser (chrome and Safari) crashes after changing the src 3 times

elalish commented 3 years ago

I believe there is likely a memory leak; I was not able to find its source (or to get reliable feedback from dev tools) the last time I hunted for it. It's probably time to try again. If anyone loves hunting memory leaks in JS, help would be most appreciated 🙏.

designbyadrian commented 1 year ago

I believe that this issue still isn't resolved as of 3.0.2.

diegoteran commented 1 year ago

Hi @designbyadrian, can you give us the repro steps so we can start debugging?

designbyadrian commented 1 year ago

@diegoteran Hello! Thank you for replying! I'm trying to create scenes that don't contain client models so I can create a test case. Shall I create a new ticket with a CodePen (or similar) URL when I'm done?

diegoteran commented 1 year ago

@designbyadrian Yes, please! Filing a separate Issue and filling all the fields would be the most helpful for us, since we already closed this ticket.