Hi,
I try to optimize my game (Dungeons of the Fallen on steam greenlight) since after I created a bigger map I've been experiencing RAM issues on runtime. When I get to the main gameplay screen the usage is above 1600MB with around 500 objects. When I disabled backgrounds the RAM starts with 1400 MB which is still a lot for a 2d game.
Here's the fun part. After 5 minutes even without disabling anything and with 500 objects on frame the RAM usage magically decreases to 80MB. I don't see anything in my code starting with 5 minute mark which would affect it. Is there some internal cleanup of memory every 5 minutes?
I have a quite lot of arrays loading at the beginning of frame maybe its somehow related to how they work..
I will appreciate any help!
EDIT: During another test on different map the cleanup occurred after around 2 and half minutes. On another one after 20 secs. I have no idea what triggers it though.
EDIT2: It seems not to be map dependent. On the same map the cleanup can occur after 20 seconds, after two or after five. It appears to be random..