How do I reduce consumed memory on load up with Cordova

0 favourites
  • 8 posts
From the Asset Store
Test and challenge your memory in this amazing Christmas themed memory game!
  • Hi all,

    I'm testing out my game on iOS 6.1.3 with an iPod Touch Gen 4 and it's crashing before it's fully loaded. If I try using a simulator for an iPhone 4, everything loads fine. I'm using Cordova version 0.21.7

    After looking at the memory allocation tool, my "Live Bytes" total is 2-3 MB and my "Overall Bytes" is almost 30 MB. Interestingly enough, if I go to the Activity Monitor, it shows my "Real Memory Usage" as 120.74MB and my Virtual Memory usage at 193.24MB. Keep in mind, this is all before loading fully. Altogether, my project is 25MB, so I'm really confused as to why I'm allocating so much other memory. Also the Leaks profile tool doesn't show my anything.

    Anyway, does anyone have any experience with this? I'm not even sure if I'm asking the right people now since I haven't anyone else have this issue. Is it with Cordova? Any help or direction would be great. Thanks!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 1-read about performance tips (there is 2)

    2-read tutorial about "dont waste your memory"

    3-dont put a lot of object on default layout "start layout" and specially don't put a lot of action on it

  • I'm reducing the size of my images (they're pixelated anyway, so I don't know why I decided to import them at such a high resolution).

    Is a physics engine required? I don't think I actually need one. I'm doing a drawing game, so all the input is touch based and there's no collisions or anything like that. I just didn't know if it was being utilized to do some critical tasks or if I could safely take it out of my index.html

  • Another fun bit of information I just found out:

    When I load the app up on the iPhone 4 simulator, after load up, it's taken up a whopping 331MB. Something is definitely going wrong here.

  • When loaded images take up their whole size in memory..

    Compression is just for saving..

    so an image of 1024x1024 will take up 1024x1024x4 bytes = 4.2 Mb of memory, regardless of how big it was when saved..

  • Even uncompressed, all of the images in my images folder only take up a little over 5MB

  • Another fun update:

    I removed all the textboxes, Facebook plugin, and Phonegap plugins from my game to export with CocooonJS. After loading it on the phone, I'm seeing it's still taking up 64 MB. Yikes. Though there's definitely something up with Cordova, I'm going to be looking at reducing the memory usage in my game as much as possible. I think my music may be too big. It's also being stored in two different file formats, so that's not helping, I'm sure.

  • I think I may know you gizmo dude. If it's strictly a Cordova issue then just compiling a blank c2 project(absolutely nothing) would compile to a massive size. Have you tried that to see if it's Cordova specific or the music files like you are mulling over?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)