Ejecta memory management testing

Discussion and feedback on Construct 2

Post » Mon Apr 07, 2014 7:09 pm

Hi all,

The new Ejecta exporter for iOS currently suffers the same problem as CocoonJS: it will try to load everything on startup, which makes large games take ages to start and possibly crashed if it ran out of memory. Thankfully Ejecta is open source so it can be hacked to the way we want it to work!

I've come up with a first implementation of memory management for Ejecta. I don't have a lot of experience with iOS development or Objective-C, but I got it working for Space Blaster. However it's important to get real-world testing to make sure it works for everyone's games, many of which are much bigger and more complicated!

To try it out, download the Ejecta source from my fork here and compile with these files instead:

(Link removed 20th June 2014. Our code was subsequently merged in to Ejecta so there is no separate repository any more. The main code is available as always from https://github.com/phoboslab/Ejecta)

In WebGL mode it should have full memory management support, and should be able to release textures from the old layout when moving to a new one. However canvas2d mode in Ejecta still doesn't support least-recently-used eviction like real browsers do, so it won't release textures. As you move through the game it will still accumulate everything in memory and may end up crashing still. Support for this could be added, but I'm not sure why you'd want to disable WebGL mode anyway.

If it's broken, it might crash, in which case the text of the error log should be useful. Hopefully though your games will start up a lot faster, and use less memory. I'm especially interested in feedback if your game previously crashed on startup, or suffered annoyingly long loading times - let me know how it works!
Scirra Founder
B
387
S
230
G
88
Posts: 24,249
Reputation: 192,450

Post » Mon Apr 07, 2014 7:13 pm

Ashely Seriously THANKS SOOOOOO MUCH for that :)
B
85
S
14
G
6
Posts: 72
Reputation: 7,237

Post » Mon Apr 07, 2014 7:21 pm

Gonna test it as soon as I get my hands on my macbook.
B
33
S
12
G
7
Posts: 227
Reputation: 7,582

Post » Mon Apr 07, 2014 7:36 pm

Excellent news! I will give this a go later today....
I only occasionally visit - I'm learning C# for Unity, but c2 is still a respectable game engine imo....
B
73
S
19
G
66
Posts: 2,198
Reputation: 42,193

Post » Mon Apr 07, 2014 7:52 pm

Awesome, really looking forward to testing this.
Moderator
B
72
S
14
G
11
Posts: 900
Reputation: 11,920

Post » Mon Apr 07, 2014 8:04 pm

damnd, that's fast Ashley. You rock.

While I overall understand your hesitancy for supporting non Browser wrappers. It seems with Apples current stance on non WebKit browsers we are stuck. Thankfully Ejecta is open source and offers alternatives paths to closed source. So thank you so much.
B
90
S
18
G
9
Posts: 2,455
Reputation: 15,013

Post » Mon Apr 07, 2014 8:21 pm

If this works, you're a hero. Great work!
B
17
S
4
G
4
Posts: 143
Reputation: 4,004

Post » Mon Apr 07, 2014 8:43 pm

Ashley,

Thank you so much for putting this together. You continue to amaze.
www.simbucket.com - HTML5 Science Simulations / https://www.airconsole.com/#!play=com.n ... obotrumble - Robot Rumble on AirConsole
B
46
S
12
G
20
Posts: 363
Reputation: 14,299

Post » Mon Apr 07, 2014 9:06 pm

get other problem always result with the potrait mode when build on simulator.... :(
B
5
S
1
Posts: 1
Reputation: 504

Post » Mon Apr 07, 2014 11:26 pm

The game that previously needed some 15 seconds to load now loads instantly, memory usage of the loaded game dropped from 280mb to 90mb.

Moving from the loader layout to another layout crashes the game: EXC_BAD_ACCESS (code=1 address=0xe145a1cd)
B
33
S
12
G
7
Posts: 227
Reputation: 7,582

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 9 guests