More layouts = more ram usage ?

Discussion and feedback on Construct 2

Post » Fri Sep 27, 2013 12:30 pm

RAM measurements are typically a little inaccurate since there are different kinds of allocations and issues like fragmentation that make it hard to come up with a single meaningful number. However layouts should not use much more extra RAM. They will need to store the initial objects (so it can load the layout when you go to it). Do you have a lot of initial objects on these layouts? I'd think you'd need in the thousands to make the results you see.
Scirra Founder
B
402
S
238
G
89
Posts: 24,644
Reputation: 196,095

Post » Fri Sep 27, 2013 12:46 pm

Thanks to your answer Ashley.
No pb about the indication, it was just to tell, in case of cause i'm lost, but i don't often look at it, i prefer to test everyday on my device and measure it there.
My pb is not the ram in itself, but the fact that just duplicate scenes increase it.
i have around 40 sprites in total, including spreadsheets, 512 size max.
I just duplicate scenes, so there are exactly the same, no more "new" objects. I'm around 100/150 max objects on a layout.
Maybe i can send you my project to have a look at it ?goldentreee2013-09-27 12:47:03
B
12
S
6
G
2
Posts: 105
Reputation: 3,969

Post » Tue Oct 15, 2013 4:09 pm

I still have the pb.
Even if i add no new images, each time i create a new layout and use images sprites used already in the project, or duplicate a layout, without adding nothing, my ram increases. (ios)
Can the total number of object in the project be the cause of that ? Maybe each instance takes a piece of memory ?
Can it be a graphic card pb ? (mine is up to date)
B
12
S
6
G
2
Posts: 105
Reputation: 3,969

Post » Tue Oct 15, 2013 7:31 pm

Me again. I think it's linked to the number of instances.
When i duplicate a layout with 100-150 objects, it adds around 1 mo.
When i duplicate a layout with 300 objects, it adds around 2 mo.
So obviously, i don't know if it's a bug or not, but it seems to be linked to the total number of instances.
B
12
S
6
G
2
Posts: 105
Reputation: 3,969

Post » Wed Oct 16, 2013 1:59 am

@goldentree,

Just out of interest, what method are you using to import your game into xcode? Could this be a manifestation of how that wrapper handles the code? Thanks.

Edited - disregard, I just read the Ejecta thread...Colludium2013-10-16 02:03:17
A big fan of JavaScript.
B
76
S
20
G
76
Posts: 2,285
Reputation: 47,554

Post » Wed Oct 16, 2013 2:52 am

I have the same pb with both cocoonjs and ejecta, so i suppose it comes from C2.
B
12
S
6
G
2
Posts: 105
Reputation: 3,969

Post » Wed Oct 16, 2013 4:47 am

A last post about that and if there is no solution or answer, well, forget it, i will do with it.

Just to detail what i have :

My game uses 42 mo (with ejecta, 50 with cocoon, but it's not linked to my pb, ejecta has just a better use of ram) on my devices. 12 are the "base" that you can't get rid of, the rest is what i did, so around 30. My pb is that i'm only using that in my images folder :

7x256 > 1.8 mo (spritesheets)
4x128 > 0.2 mo (spritesheets)
4x512 > 4.2 mo (spritesheets)
2x64 > 0.03 mo
8x8px > like nothing

(if i was good in calculate the use of ram as written by Asley here : https://www.scirra.com/blog/112/remember-not-to-waste-your-memory)

I'm doing nothing specific in my code, but i noticed that the more events you have, the more it uses memory too, even if it's not enormous, it's there (i have actually around 300 events in total).

So whatever, it's just to show that my game is optimised on that point, cause it doesn't change the pb : i don't know why i'm using so much ram, and why when i re-use my graphics, or duplicate a scene, the ram increases so much, even if i don't add events.

@Ashley : can i send you my project to have a look ? Maybe i'm doing something wrong somewhere or maybe you can see what is not working ?goldentreee2013-10-16 04:56:05
B
12
S
6
G
2
Posts: 105
Reputation: 3,969

Post » Wed Oct 16, 2013 11:54 am

Oh right, well CocoonJS and Ejecta are known not to implement memory management, so will try to load the entire game in to memory on startup. This is a problem with the platforms themselves, not C2.
Scirra Founder
B
402
S
238
G
89
Posts: 24,644
Reputation: 196,095

Post » Wed Oct 16, 2013 12:14 pm

Thanks Ashley.
No link to the memory manager, i just add more instances of the same sprites, that's all, and the ram increases (a lot). But maybe what you want to say is that it's normal thats this happens with that software (cause in my head memory manager means "layout by layout loading", but maybe it's more than just that, and includes the management of the instances).
Whatever there are no solutions to my pb, so done.
B
12
S
6
G
2
Posts: 105
Reputation: 3,969

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 6 guests