GS auto dumping assets to clear RAM

HoneyTribeStudiosHoneyTribeStudios Member Posts: 1,792
edited September 2012 in Working with GS (Mac)
So a few builds ago GS introduced a feature to prevent our apps from crashing. Unused images should now be auto-dumped from the RAM if the device is getting close to it's limit. So we shouldn't really have crashing issues due to RAM usage.

Just wondering how peeps are finding this in practice? And if it has translated well to all platforms or just iOS? Does android perform this well?

If a GS dev happens to see this post it'd be good if they could offer some guidelines.

I'll be 'stress testing' a 3rd gen ipod and 1st gen ipad so will post here on my findings. Hopefully I can keep a new game to one scene to avoid loading times. Will find out soon enough!

Cheers

Comments

  • LuckyLurcherLuckyLurcher Member Posts: 343
    I've been trying to get a large game to work on iPad 1, but it keeps crashing due to RAM use. I have restructured the game about 5 times trying everything I can think of including changing images using spawning and destroying, change image behavior & change self.Image. The RAM usage seems to keep creeping up, and only occasionally does it drop back down to what I should be. I don't think the images are getting auto dumped well enough to stop crashing. So I just decided yesterday to make my game only available for iPad 2 & 3 buy releasing it for iOS 6 only.
  • MarkOnTheIronMarkOnTheIron Member Posts: 1,447
    I made some experiments on this a while ago: http://forums.gamesalad.com/discussion/39924/

    The only real problem I saw is that when the old image RAM is dumped when an animation is happening there could be some glitches in the animation, and that happens even on an iPad 3 or iPhone 4S.

  • HoneyTribeStudiosHoneyTribeStudios Member Posts: 1,792
    @LuckyLurcher - Hmm, well that's doesn't sound encouraging but thanks for posting :)

    @MarkOnTheIron - Ah I'd forgotten about that post. Cheers - yeah that was what I was thinking should happen.

    But I'll see how it translates to one of my new games later today. It will have more images then the device can handle so hopefully I'll find it dumps them as I progress through the game.
  • 3itg3itg Member, PRO Posts: 382
    @MarkOnTheIron Is this still working the way you would expect it to?
    And was there anything you have noticed that seem to mess up or stop the dumping behavior.
    I search the forums everyday to find things like this, and what the issue could be with my application.
    You mentioned that GS sees what other apps are consuming, but in my experience the dumping behavior doesnt seem to be self aware. Like if other aspects of GS are consuming lots of resources, Dumping still occurs, but it doesnt seem to release or deallocate enough to prevent crashes.
    (I am not sure about this, just looking at potential connections to try to figure this out)
  • HoneyTribeStudiosHoneyTribeStudios Member Posts: 1,792
    edited September 2012
    So as Mark had already found, images are being dumped as you would expect. I tested using retina sized images on a non-retina ipod.

    So every time the total RAM got to roughly 90mb the images would all be dumped. The data for 'engine' and 'other' remained in the RAM. Although I should point out that SSS has said the viewer numbers are not 100% indicative of how the published app will perform.

    I'm hoping this works on android and windows 8 too? If anyone has experience of that feel free to post.

    A few peeps said they were having problems with this feature. Just to explain how my game is using images, here's a brief summary:

    It's a puzzle/adventure game where every screen has a different full screen background and different objects placed on top.

    I never use the change image behaviour.
    I always use the change attribute behaviour and change the self.image attribute.

    Each screen reuses the same objects.

    e.g I have one 'peson1' actor, one 'background' actor etc.

    Then I have table data with the sizes, positions and image names for each object in every screen.

    Then I have a game.refresh attribute. So when the player moves to the next screen game.refresh is activated.

    Then every object has rules like this one:
    When refresh = true
    Change self.image to tableCellValue( game.myImageTable ,row, column)


Sign In or Register to comment.