Jump to content

CanvasPool memory problem after recreating state


soylomass
 Share

Recommended Posts

It's me again.

I have a problem with my game. Whenever a user changes server, I recreate the game (because otherwise I should reset a lot of things) using:

game.state.start(game.state.current, true, false, host);

It works fine, but each time I do this, the memory grows a lot. I've checked the memory profiler of Chrome Console, and I see that there are a lot of big BitmapData inside CanvasPool, which explain most of the used memory:

mem.thumb.png.4ea2ced1d184d5efead23a85c6ef5f7e.png

mem2.thumb.png.9c373002e2f1c558271a1c2a2eece692.png

 

Is there any way to avoid this? It causes crashes in low memory devices (like most mobile phones).

Thanks in advance.

Link to comment
Share on other sites

3 hours ago, samme said:

Are you creating BitmapDatas or RenderTextures? You can destroy them when restarting the state.

I am, actually, but didn't destroy them manually. I thought they would be destroyed when restarting the state :P I'll try that. Thanks!

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...