Hagop Posted January 16, 2016 Share Posted January 16, 2016 Hi all I am using Mozilla Firefox ver 43 and I have quite a large Babylon.js project Upon making several F5 browser refreshes, I get "out of memory" situation (Error: WebGL: texImage2D generated error OUT_OF_MEMORY). It is evident that for example scene.registerBeforeRender ( and possibly other babylon functions stay resident in memory) continues to run for a few seconds after F5 is pressed (just use console.log to in registerBeforeRender to verify my claim). How can I dispose, or clear the memory immediately F5 is pressed. Do I need a javascript directive and where do I place it? Dieterich 1 Quote Link to comment Share on other sites More sharing options...
ChrisR Posted January 16, 2016 Share Posted January 16, 2016 Try: $(window).bind('beforeunload', function(e){ scene.dispose(); e=null; }); //or $(window).bind('beforeunload', function(e){ scene.unregisterBeforeRender(<<FunctionName>>); e=null; }); Quote Link to comment Share on other sites More sharing options...
ChrisR Posted January 16, 2016 Share Posted January 16, 2016 Sorry thats JQuery, you asked for javascript... Try: window.onbeforeunload = function(e) { scene.dispose(); e = null; //setting e to null allows the refresh }; Hagop 1 Quote Link to comment Share on other sites More sharing options...
Hagop Posted January 17, 2016 Author Share Posted January 17, 2016 Thanks ChrisR Great improvement, almost fixed, except for on refresh I get a new error Error: No camera defined babylon.js:9:19269 There seems to be some memory leakage still, but things work fine. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 17, 2016 Share Posted January 17, 2016 Hitting f5 should generate a complete memory cleanup. This is definitely a Firefox bug Quote Link to comment Share on other sites More sharing options...
Hagop Posted January 18, 2016 Author Share Posted January 18, 2016 Delkatosh, you are right as Chrome doesn't have the problem. So how do we contact Firefox ? lol Quote Link to comment Share on other sites More sharing options...
RaananW Posted January 18, 2016 Share Posted January 18, 2016 [email protected] ? ir better yet here - https://bugzilla.mozilla.org/ Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.