- Home /
How should a Unity web application gracefully exit?
So our application on Unity Web Player is relatively memory intensive (about 1GB according to Activity Monitor). We have found that loading the website with our our Unity app, closing the browser window, and then reloading the website causes the viewer to sometimes fail on start the second time. We have noticed that memory use of the plugin tends to hover at 1GB even after our app closes. We saw this on both firefox and chrome (on Mac OS). However, if we force-close the Unity Web Plugin prior to reloading the page, it works fine.
We are wondering if there is a proper way for the Unity application to release resources if it fails to load. Is there a specific command that is called to allow us to clean things up, or should all this happen automatically.
Answer by Dreamora · Sep 16, 2012 at 12:53 PM
The easiest is to refresh the document / page itself either into the same page or one without the player present. Plugins will not 'gracefully' go away without a page refresh normally on the majority of browsers, and Unity definitely won't out of my experience.
Hi $$anonymous$$arc,
Thanks for the response. Unfortunately, this does not solve my problem since the plugin process itself persists across reloads of the page, even if our Unity content restarts. After some more investigation, it appears that Unity's web plugin process leaks at least 40$$anonymous$$B (and sometimes a lot more) every time a page with Unity content on it is reloaded. (I tested this on the Unity Tropical Paradise demo). So I really need a way of either forcing the plugin or my Unity content to clean up its memory use as it does not appear to happen automatically.
Your answer
Follow this Question
Related Questions
How do I get Unity Web Player to clean up memory leaks? 1 Answer
How to send textures native ptr from web player to NPAPI browser plugin? 1 Answer
Are There Any Plans To Support HTML5 In Unity? 7 Answers
Web Browser in a scene exporting the project to run it in the WebPlayer 0 Answers
I have a big project building for webplayer. Is there any browser to run it yet ? 3 Answers