Jump to content

CanvasPool memory problem after recreating state


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:




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

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

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