How do I manage memory and speed up loading

Just started using Construct 2? Post your questions here

Post » Fri Oct 03, 2014 9:32 pm

Message: bitlab is not yet permitted to post plain text URLS (300 rep required). 5 URLS removed. Why?
Hello.

I am sorry if duplicating these questions, but i could not find clear answers in the forum. Thank you.

1. if "go to layout N" from layout "N-1", is layout N-1 garbage collected in memory automatically?
2. if sprite-type is destroyed, is its image memory freed?
3. a. if "big" sprite-image is scheduled to be loaded dynamically after first layout load is completed, why the sprite apparently (?) sill makes a HTML-request for a "default" empty image in first layout load
anyway to avoid this?
b. if sprite had image at design-time, but on later design one needs to remove this image,
in favor of dynamically loaded image, how to do this?

4. Apparently, no matter is the N+1 layout is used, it is still loads to the web browser at landing time.
What are the ways to avoid this? I use just one: make image download dynamic and catching the "onload" event.
Are there any more organized ways of doing this?


These links did not help, perhaps i don't understand something:


Other links concerning memory:
Memory use, huge problem for large games on mobile


Thank you.
Konstantin.
B
4
S
1
Posts: 13
Reputation: 374

Post » Mon Oct 06, 2014 10:55 am

I don't think this belong in the beginners section, it is not easy to answer I think. :D

And you would probably need Ashley to answer it correctly. Tried doing some tests but the more I tested the less sense the results made, and didn't produce anything that could answer your questions.

For instant it seems that if you create a image for 1 layout and destroy it straight away the memory is not freed up, which makes a bit of sense if you should need the object later. However if you switch layout some of the memory is freed but not all, even though there are no objects, but you can still make all the objects in your project, again could be because you can then make the objects, however it is still able to free up some. And what exactly are freed up I couldn't figure out.
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,838

Post » Mon Oct 06, 2014 2:08 pm

These kinds of questions come up from time to time, so instead of answering repeatedly on the forum I wrote a new manual entry covering memory use:

https://www.scirra.com/manual/183/memory-usage
Scirra Founder
B
395
S
232
G
88
Posts: 24,371
Reputation: 193,762


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests