HELP! Memory issue... :(

Hi, we try to run the game in iOS Device (iphone5s) but we have this error:

Received memory pressure event 16 vm pressure 0

Message from debugger: Terminated due to memory issue

from a scene to other.

Some people could help us? Many thanks (we need to send the game :tired_face:

INFO: Every scene has flag ā€œAuto Release Assetsā€ at true and we load the scene with:

    cc.tween(cc.BOOTLEVEL.node).delay(1.0).call((target)=>{
        cc.director.preloadScene(cc.gameData.level.currentLevelName, function (error, asset) {
            
            cc.tween(cc.BOOTLEVEL.node).delay(.1).call((target)=>{
                cc.director.loadScene(cc.gameData.level.currentLevelName);
            }).start();
    })}).start();

on android we donā€™t have this trouble, why??? :frowning: :cold_sweat:
Thanks for help!

INFO: Screenshot from iOS profilerā€¦ the memory comes to 245mb and after the system crashā€¦ how is possible? the new scene donā€™t have so many texture :frowning:

we use cocos 2.2.2 but the trouble is also 2.3.3 :frowning:

help please!

@Big_Bear Hi, is it possible that the texture from texturepackar (so the atlas) is not released when we change the scene? Thanks.

Is there web mobile or native app ?

native app (iOS)

What if you set ā€˜Async load assetsā€™ on scene ?

we donā€™t have tried with async load :confused: is a possible solution? maybe the system release the unused texture when create the new scene? we use only cc.director.preloadScene and after cc.director.loadSceneā€¦

i know that , if you set ā€œauto release assetsā€ and donā€™t do manage your assets by self, it cause errors of load next scenes. like a some assets used in more than one scene which marked as ā€˜auto release assetsā€™ and you donā€™t load those assets by self it causes an error. it seems some assets which unloaded canā€™t be loaded by scene again.

but when we change the sceneā€¦ cocos donā€™t destroy the nodes inside it? and when are destroyed they arenā€™t unload from memory? (see texture etcā€¦)

use cc.sys.garbageCollect(); after release a scene.

My memory clean algorith is

  • Before load the next scene, mark the current one as auto release (just to be sure) and mark what shoud be loaded before load the next scene
  • Go to a memory-clean scene
  • Release all the assets used (I use cc.loader.releaseResDir() on specific folders)
  • Call cc.sys.garbageCollect(); to release it
  • Load the marked assets
  • Load the next scene

Do you have a little sample to do this? If this its not a trouble. :blush: many thanks for help!!

Dude, I donā€™t know if I can send the code here (itā€™s on my workā€™s project), better not to, sorry.

The best I can do is share that algorith.

would be great! Thanks.