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
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???
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
we use cocos 2.2.2 but the trouble is also 2.3.3
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 ?
What if you set āAsync load assetsā on scene ?
we donāt have tried with async load 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. 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.