destroy() method needed
See original GitHub issueA .destroy()
method is needed and not just nullify.
For some reason even after nullify of the main object and clearing everything, after a few uses (different 360s in different places), even with proper unloading, it takes up more and more memory.
Maybe some ThreeJS objects not unloading ?
For mobile use 4,5 load/unload of totally different routes for PSV
will crash due to out of memory
which is common for big WebGL based apps
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:6 (4 by maintainers)
Top Results From Across the Web
When should I use the destroy method? - javascript
A better question, why do you need to destroy anything? if the window is unloading, everything will be garbage collected on your behalf....
Read more >Spring - init() and destroy() Methods with Example
Here myPreDestroy() method will be defined in the Student class. Spring will call this method just before destroying the bean. destroy-method is ...
Read more >Java.lang.Process.destroy() Method - Tutorialspoint
Description. The java.lang.Process.destroy() method kills the subprocess. The subprocess represented by this Process object is forcibly terminated.
Read more >What is the thread destroy() method in java? - Educative.io
The destroy() method is used to stop the execution of thread groups and subgroups after the completion of the run() method, which executes...
Read more >Spring init-method and destroy-method example - Mkyong.com
In Spring, you can use init-method and destroy-method as attribute in bean configuration file for bean to perform certain actions upon ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m currently having this issue. Was this never fixed? My panorama viewer fills hundreds of megabytes of memory every time I load it. I set up a
viewer.destroy()
call whenever the viewer component is destroyed to dispose of it. However, I still see increasing memory usage each time I close and open the viewer.So I added a “destroy” method, the biggest part has actually been to unregister the event handlers (without jQuery namespaces it can be tricky).
But from my (very quick) tests, although I clean every ThreeJS objects as everyone told to do, my memory usage still gain 100Mo on each destroy/create cycle. https://github.com/mistic100/Photo-Sphere-Viewer/blob/master/src/js/PhotoSphereViewer.js#L176-L194