Richacinas Posted July 4, 2017 Share Posted July 4, 2017 Hello there, I'm trying without success to find all stages and renderers that PIXI has in memory, so I can call destroy on them and their children. I'm sure there is a way to have that so I don't have to keep track on my application. It is a React website and therefore the component that had that reference is unmounted and then mounted again later on. When I instantiate a new stage and renderer, I can see them piling up and using a lot of memory as I go from one part of my website to another. How could I find all instances so I destroy them before creating new ones? I have the global PIXI object on window... Thanks a lot! Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted July 4, 2017 Share Posted July 4, 2017 PIXI has texture cache (PIXI.utils.textureCache and baseTextureCache), so you can find textures that were't destroyed. There are no caches for renderers, its up to you to store them somewhere.. Stage elements do have no bound webgl resources, so its ok to ignore it and just wait when javascript GC takes care of them. I recommend to re-use canvases and webgl renderers, and make sure that number of active renderers is small, there's a limit on that in browsers. 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.