How do I reduce consumed memory on load up with Cordova

Get help using Construct 2

Post » Tue Sep 16, 2014 4:58 am

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!
B
4
S
1
Posts: 35
Reputation: 420

Post » Tue Sep 16, 2014 8:00 am

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
B
45
S
16
G
8
Posts: 792
Reputation: 8,306

Post » Tue Sep 16, 2014 8:08 am

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
B
4
S
1
Posts: 35
Reputation: 420

Post » Tue Sep 16, 2014 8:41 pm

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.
B
4
S
1
Posts: 35
Reputation: 420

Post » Tue Sep 16, 2014 8:48 pm

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..
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Sep 16, 2014 9:18 pm

Even uncompressed, all of the images in my images folder only take up a little over 5MB
B
4
S
1
Posts: 35
Reputation: 420

Post » Wed Sep 17, 2014 2:24 am

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.
B
4
S
1
Posts: 35
Reputation: 420

Post » Wed Sep 17, 2014 4:35 pm

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?
www.h1k3.tech

We are here for you!
B
87
S
22
G
16
Posts: 715
Reputation: 16,765


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 12 guests