The BIG game challenge (Ejecta memory management on iOS)

Discussion and feedback on Construct 2

Post » Thu Jun 12, 2014 6:20 am

Silverforce wrote:At the moment, it is not recommended to make big games with lots of art assets for iOS, its just not possible given our current wrapper toolsets: Ejecta and CocoonJS.
For Android, its only possible thanks to Crosswalk, but again, its missing quite a few monetization features. It's a waiting game unfortunately.

We just have to make do with games that don't use too much big art or lots of big animation frames.


@Silverforce - are you suggesting that my app is too big to ever run on iOS? I did not give up yet...
B
12
S
3
Posts: 104
Reputation: 1,655

Post » Thu Jun 12, 2014 8:49 am

MaorKeshet wrote:
Silverforce wrote:At the moment, it is not recommended to make big games with lots of art assets for iOS, its just not possible given our current wrapper toolsets: Ejecta and CocoonJS.
For Android, its only possible thanks to Crosswalk, but again, its missing quite a few monetization features. It's a waiting game unfortunately.

We just have to make do with games that don't use too much big art or lots of big animation frames.


@Silverforce - are you suggesting that my app is too big to ever run on iOS? I did not give up yet...


Have you checked how much memory it uses on iOS yet?

Because older Apple devices have 512mb of ram and if your App uses more than ~200mb, its likely to crash.
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,614

Post » Thu Jun 12, 2014 9:52 am

Fyi game that currently crashes on me with cocoon js takes 150mb on preloader scren, 190mb on cover screen and it crashes at gameplay screen - probably because it uses more than 200mb then.

Browser webgl memory usage is at 32.7mb.

Im just going to wait for year for ios8 and 80%+ users using it to build with phonegap. There is no point in releasing larger game right now since cocoon sucks hard.
B
22
S
7
Posts: 94
Reputation: 1,783

Post » Thu Jun 12, 2014 11:43 am

You can release larger games, it will mean you have to set the minimum specs for devices with 1GB of memory. That rules out iPhone 4S and older iPads, unfortunately.
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,614

Post » Thu Jun 12, 2014 3:11 pm

Silverforce wrote:Other users have reported a temporary spike (doubling) in memory use during layout changes with Ejecta. That spike can cause crashes if the device doesn't have enough memory to handle it.


Sounds like this could be the culprit for Maor's project. Does Ashley know about this?
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,028

Post » Thu Jun 12, 2014 4:48 pm

jayderyu wrote:
Silverforce wrote:Other users have reported a temporary spike (doubling) in memory use during layout changes with Ejecta. That spike can cause crashes if the device doesn't have enough memory to handle it.


Sounds like this could be the culprit for Maor's project. Does Ashley know about this?


@Ashley ?
B
12
S
3
Posts: 104
Reputation: 1,655

Post » Thu Jun 12, 2014 4:59 pm

That shouldn't crash the game. It's normal in garbage collected languages that the memory can spike up quickly, but as it does so it should collect to release older resources to avoid running out of memory. So I'm not convinced that's the problem.

I would recommend filing an issue with the Ejecta developers since they've now merged in my code (with changes).
Scirra Founder
B
398
S
236
G
88
Posts: 24,428
Reputation: 194,600

Post » Fri Jun 13, 2014 7:13 am

@Ashley - did you see my earlier comment about getting better results with your ejecta template (over the official one) ? I am a bit confused which would be the correct template to use at the moment...


jayderyu wrote:In the mean time. how about another experiment. Full game, but remove the audio from the project entirely. I wouldn't think there would be much of a problem with audio if it's not being called. but might as well experiment. audio also tends to unpack to larger sizes in memory.

@jayderyu - I run a "No Audio" test but the results are identical.
B
12
S
3
Posts: 104
Reputation: 1,655

Post » Mon Jun 16, 2014 1:46 pm

I got my hands on a Macbook and I run many tests on Xcode connected directly to the iOS device. So long for the "create games without any programming skills" concept"....

The memory graph helped me to do some further optimization on the assets and most games are now functional on the iOS device, if accessed upon app launch .

But when navigating from game to game the memory load builds up and once it hits ~235Mb, it crashes with a "memory pressure" message. (I run the tests on a 512Mb RAM iPad mini since my pre-ordered app has to run on such devices).

According to the tests described below, even if the app will be limited to 1Gb RAM devices, it will still crash when loading few more layouts (more games or more screens within a game, I have more than 70 game layouts in my app).

The official Ejecta template was used to create the test app.
https://dl.dropboxusercontent.com/u/8918895/Full%202.1%20shrink.zip - This is a copy of the App Folder I used in Xcode, if you care to reproduce the test or run any other tests.
And this is a diagram of the app structure, so it is easier to follow my tests.
https://dl.dropboxusercontent.com/u/8918895/App%20Structure.JPGImage
Web version of the app can be found here http://www.malanapps.com/klalit/
(I can't publish the capx since the client owns the app code. I can share it by PM if you wish).

The tendency of all the test graphs upwards (A-B), with no effective clearing is very obvious.

TEST 1:
https://dl.dropboxusercontent.com/u/8918895/T1.jpg Image
This test shows that when returning to the same layout (outdoors lobby) over and over, memory usage of this layout goes up constantly (sections 1,2,3).

TEST 2 shows that when returning to a layout that was used before, utilizes more memory than it did at first entry (sections 1 & 2)
https://dl.dropboxusercontent.com/u/8918895/T2.jpg Image

TEST 3 shows that even while navigating back and forth between two layouts the memory usage still goes up (1,2,3)
https://dl.dropboxusercontent.com/u/8918895/T3.jpgImage

Some Garbage Collection is happening from time to time (yellow stars) BUT it is not really effective as it is very minor and rare :(

There is a very small headroom left for additional optimization by sizing down the assets (I already have pic quality issues on the iPad). So I wonder what my next step should be :roll: Any idea will be appreciated :geek:

The responsibility for memory management and garbage collection falls between Scirra and Ejecta and we are stuck in the middle.... Is this going to be the big break for C2 on iOS or is it going to be a "re-run" of the frustrating C2-CocoonJS situation??? I am wondering... and hoping for the best...

EDIT: I have posted the same issue at phooslab https://github.com/phoboslab/Ejecta/issues/401

@Ashley - Are there any specific log files that may help to resolve this issue :?: :?: :?:
Last edited by MaorKeshet on Mon Jun 16, 2014 9:16 pm, edited 1 time in total.
B
12
S
3
Posts: 104
Reputation: 1,655

Post » Mon Jun 16, 2014 2:43 pm

Hmm. Match and Dots seemed to explode the memory. However it looked like when leaving Match not all the assets were released as the the memory was higher than just going about the lobbies. I'm wondering why. It does seem that when leaving match tot he lobby that memory should have cleared down to just the lobby values.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,028

PreviousNext

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 7 guests