Reduce memory of empty project

Reduce memory of empty project

Hi guys! From a quick check, i see that empty cocos scene project needs about 90-100mb of ram. Is there any way to reduce this? e.g. not include some libraries that are not used etc.


Can you give extra details like what platform you test on? What was cocos2dx version? What profiler?


Are you sure that application really use this memory? What operation system you run? Maybe it’s just reserved virtual memory or maybe that value means total memory used by all application components. Even with empty scene application can require huge amount of memory for frame buffer, especially if it’s use triple buffering (almost 24MiB for FHD screen just for color buffer).

It’s can be also just your fault if you run debug version of code with build in all data required to debugging. Amount of debug symbols are enormous for C++ applications…


@tink3r_t @fgssledz I run test on iphone xs max with cocos2d-x v3.17.1 in release mode and ram is as profiled in xCode. Here is screenshot. Is there any technique to reduce this even further than the default?

For example, I am not using any 3d staff, or Parallax or Tilemaps or Particles etc. Is it possible that i do not include some parts of cocos that are imported in cocos2d.h or will that break staff? If we take example the 3D, all these are loaded:


You are saying that if I

  • run cocos new ...,
  • open the Xcode project
  • remove unnecessary default sprite and labels from HelloWorldScene
  • run this on my iPhone X hardware

I am going to see about 100mb of RAM usage like your screenshot above?


@slackmoehrle please do try i hope i did something wrong. Xcode 10.1(10B61 - MacOs Mojave 10.14 - and device running iOS 12.1.4). As soon as you can verify i can try with different devices too, see how much resolution of device affects startup memory.


I’ll need to update my OS and Xcode, perhaps. I am still on 10.13.


@slackmoehrle do try this test on v10.13 first. Ideally, you should be able to reproduce.


Yeah, I planned to just so we have more data to make a better decision with.


i agree with your idea


@slackmoehrle ping ping dont forget me )))


I didn’t. I upgraded to 10.14 and it bricked my laptop. Doing an internet restore doesn’t ever complete. I had to take it to an Apple Store for repair. Still no word yet.


Oh sorry to hear that ((


LOL, so was I. Something about it being a touchbar model, I guess…


T1 chip can be a problem :slight_smile:


i have touchbar model too but all ok with mojave. Only issue is that xcode might crash often ) and apple magic mouse sometimes unresponsive )


Thanks. I received a call from Apple that they want to replace the motherboard too as preventative maintenance they also had some hoops to jump through when trying to get an OS back on it. Uncommon hoops. But this is on my list.


ding dong! )


I have the machine back now and 10.14 loaded. I’ll get on this.