question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

destroy() method needed

See original GitHub issue

A .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:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
cyruscuencacommented, May 5, 2020

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.

0reactions
mistic100commented, Jan 23, 2016

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found