简体   繁体   English

three.js内存泄漏/浏览器崩溃

[英]three.js memory leak / browser crash

I am building an app with a spherical panorama photo with a jpg size about 4Mb. 我正在用球形全景照片构建一个应用程序,其jpg大小约为4Mb。 During development I am constantly refreshing the page I am working on to see changes, as well as opening multiple other three.js example pages to get tips. 在开发过程中,我不断刷新正在处理的页面以查看更改,以及打开多个其他three.js示例页面以获取提示。 When Firefox first starts up, it uses around 250MB (I have a few tabs that open by default since it keeps crashing). Firefox首次启动时会使用约250MB的内存(由于崩溃,我默认打开了一些选项卡)。 When I refresh the page it jumps to around 420MB, then tapers slowly back down, but usually not to where it started from. 当我刷新页面时,它会跳到420MB左右,然后逐渐逐渐减小,但通常不会到它开始的位置。 If I refresh 2 times in 15 seconds or so, it will climb to nearly 500MB. 如果我在15秒钟左右刷新2次,它将达到近500MB。

Usually I am not paying attention to my memory usage singe I have 32GB, but when firefox gets up around 2.5GB of memory used, along with around 15% processor usage, it starts bogging down and will crash. 通常,我没有注意内存使用情况,因为我有32GB,但是当firefox获得大约2.5GB的已使用内存以及大约15%的处理器使用率时,它开始陷入瘫痪并崩溃。 I would understand if my scene were particularly complicated, but it isn't, for the most part it is a single spherical pano, and one additional element I am working on at the time. 我会了解我的场景是否特别复杂,但事实并非如此,在大多数情况下,它只是一个球形全景图,并且我当时正在处理另一个要素。

Is there something I should be adding to my code to clear out buffers between refreshes? 我应该在代码中添加一些内容以在刷新之间清除缓冲区吗?

Seems this is a problem with TextGeometry without a solution. 似乎这是TextGeometry的问题,没有解决方案。

https://github.com/mrdoob/three.js/issues/8478 https://github.com/mrdoob/three.js/issues/8478

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM