Arcs Posted June 11, 2019 Share Posted June 11, 2019 I'm not sure this is needed, but it seems it would be since if I refresh the game I'm working on enough I eventually get this in firefox: WebGL warning: <SetDimensions>: Exceeded 16 live WebGL contexts for this principal, losing the least recently used one. So I was wondering if when you refresh a browser window if canvas and other stuff stays in memory or the gpu since it only happens if I hit f5 enough times while checking changes to the game. Was wondering if this too could explain some slow downs I see sometimes. So is there any way to just have pixi totally unload/destroy all objects on an unload event or is this going to be done automatically anyway when you reload a window? Quote Link to comment Share on other sites More sharing options...
jonforum Posted June 11, 2019 Share Posted June 11, 2019 did you have the same thing if you do Ctrl + F5 orCtrl + Shift + R this shortcut refresh with empty cache. Arcs 1 Quote Link to comment Share on other sites More sharing options...
Arcs Posted June 11, 2019 Author Share Posted June 11, 2019 Yea I did get it with ctrl + f5 also with dev tools open and disable caching selected. ctrl + shift + f5 doesn't seem to do anything in FF tho I tried it too. One thing I noticed though is it seems to reset it if I close the tab and open a new one, still makes me wonder if it's leaving stuff live somewhere though even after unload/close and it's just not attached to the current tab so it doesn't show the warning. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted June 11, 2019 Share Posted June 11, 2019 It should be dead. I think the problem is actually that your App initialization depends on browser cache and something goes wrong with events, and your app initializes 14 times. Another possibility is that I really dont know modern UI frameworks and instead of full refresh browser just hits the anchor of your page and forces re-load of app router. Which UI framework do you use? Arcs 1 Quote Link to comment Share on other sites More sharing options...
Arcs Posted June 11, 2019 Author Share Posted June 11, 2019 PIXI.Loader.shared.add(visualassets).add(state.sound_preload).on('progress',loadingbar).load(prerungame); function loadingbar(var1){ $("#loading .bar").css('width',var1.progress+'%'); } That's our initialization. The warning only happens if I f5 in the same tab like 15 times. We don't use any UI framework unless you want t include jquery or something, only characters, backgrounds and spine files are rendered in PIXI the rest is outside the canvas such as text or even hp bars. prerungame will in order load objects from the game and create the necessary things in canvas with pixi, when that is done the loading screen is hidden and the animate loop can start. I usually have the developer tools open in firefox with caching disabled so I don't have to worry about getting a fresh copy on page refresh. I work locally so downloading stuff each time is no problem. In prerungame our canvas gets drawn with PIXI per settings parsed from text. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted June 11, 2019 Share Posted June 11, 2019 when exactly do you create Application or Renderer? Arcs 1 Quote Link to comment Share on other sites More sharing options...
Arcs Posted June 11, 2019 Author Share Posted June 11, 2019 I create the stage and the renderer as part of the loading of the game, after the PIXI loader loads all assets. This can only ever be called once since it is only ever called from prerungame which is only called from PIXI loader finishing. Quote Link to comment Share on other sites More sharing options...
jonforum Posted June 12, 2019 Share Posted June 12, 2019 left is global mem and right gpu mem from your navigator. do those value grow when you refresh your navigator and snapshot each time? it should not Arcs 1 Quote Link to comment Share on other sites More sharing options...
Arcs Posted June 12, 2019 Author Share Posted June 12, 2019 Both are growing browser mem was 18.9 then on up to 29 after enough reloads, and my gpu mem started at like 1.3 gigs used and is now at 1.7 (note I went off total gpu memory not just the browser). They both clear out, though not right away, after closing the tab. Edit: Tried the same test on chrome, no growth So that means it's a firefox select issue then? Quote Link to comment Share on other sites More sharing options...
jonforum Posted June 12, 2019 Share Posted June 12, 2019 it maybe a engine issue. Firefox use mozilla right ? chrome,edge,vivaldi use chromium engine. maybe try search in the web with thoses keyword. `mozilla` `memoryleak` `canvas` `webgl` `refresh` Arcs 1 Quote Link to comment Share on other sites More sharing options...
Arcs Posted June 12, 2019 Author Share Posted June 12, 2019 https://bugzilla.mozilla.org/show_bug.cgi?id=1501142 Well it's nice to know it's not my game. I almost wonder if it was a design choice by someone for a reason since they capped it purposefully at 16, maybe to prevent some forms of memory being called for that was cleared up for some reason idk, keeping 16 refreshes in memory isn't the most common choice here tho. Thanks for the help! Learned something and got relief it wasn't my game causing it. jonforum 1 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.