Jump to content

How can i release resrouces


GBear
 Share

Recommended Posts

hi..

i'm worrying about memory because ios has low memory(1GB under 6s)

pc and android is good to play my game but ios is crashed

i'm thinking because of memory and safari's bad memory controlling(safari is not good for webgl.  T_T how do you think about this?)

so i'm trying to reduce memory..

 

first. how can i release resources after 'load'?

maybe it doesn't need after loading so i wanna release clearly.

 

if you have any idea to control memory efficiently please give me idea to tip.. to anything ^^.

 

thx..

Link to comment
Share on other sites

So to be clear, PIXI.loader.reset() does *not* destroy those resources, it just makes the loader not hold a reference to them anymore.

You can easily manage it yourself after loading:

var cache;

PIXI.loader.add('res', 'resource.png').load(function (loader, resources) {
    cache = resources;
    PIXI.loader.reset(); // loader no longer holds onto resources, but does not destroy them

    // later, when you're done with 1 resource
    cache.res.texture.destroy(); // destroy the pixi object
    delete cache.res; // remove our reference to the resource so it is garbage collected
});

Hope that helps.

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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

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