Memory Issues

JamesBoucherJamesBoucher Member Posts: 433
edited November -1 in Tech Support
No matter what game I make for the iPhone it ends up freezing. Is this going to be fixed. I can start with five actors and have them chase another actor and within a minute have it freeze.

When I destroy an actor in GS does it release this object. When I program using xcode and a release an object I can see the memory allocation go down (debugging using instruments). When i destroy an actor in GS I do not see the memory allocation go down (once again using instruments). In GS the memory allocation just keeps going up and up.

How do I avoid this? When will it be fixed?

Comments

  • butterbeanbutterbean Member Posts: 4,315
    I haven't had freezing problems yet, only crashing when too many actors on screen, or if there's a glitch.

    I know that bigger games like platformers can be more difficult and takes up a lot of memory, I found I had to sacrifice graphics for gameplay, and smooth framerates.

    Is your viewer updated and matching the current version of GS? Is GS 0.6.2 and your viewer updated via xcode?

    Good question on memory allocation, I would like to know this one too
  • JamesBoucherJamesBoucher Member Posts: 433
    My GS is 6.2, GS viewer is 6.1, and xcode is 3.1.4. When I say it freezes I mean it stop for about 5 seconds the closes. My game has rats in a maze that detects a tank moving and then go after the tank.

    My tank sets the x,y cord relative to the screen. The rats then use accelerate toward and rotate to position to chase the tank. I think this in its self is to much for GS to handle. Playing on the Mac works just fine.

    When the tank destroys a rat the memory allocation does not go down even though the rat, the explosion and the ammo is being destroyed. When i look at the console log it says out of 16mb.

    I wish I had access to the xcode because I know I could fix this.
  • JamesBoucherJamesBoucher Member Posts: 433
    OK I found the problem. The accelerate toward and the rotate to position behaviors should work in junction with a timer. If you do not specify a time then it will freeze you game. I'm guessing that it just keeps creating it's own timer (which never get released) until you run out of memory or max objects.

    So some behaviors will crash you game if not used with a timer. This only took two weeks to figure out.

    I would like to thank those who tried to help especially mulcahy for the time he put in trying to help.

    So if your getting the "Ran out of chunks of size 16" this is something to check for.
  • butterbeanbutterbean Member Posts: 4,315
    Thanks for the tips, I'm working on a new game, and noticed by the 8th level, the game crashes, so I need to figure out why, or if it's a memory leak issue as well....
  • JamesBoucherJamesBoucher Member Posts: 433
    I had ten actors using this behavior all at once. I put it in a timer with it executing ever.3 seconds. I also had to increase the acceleration to get the actors to move at a faster (acceptable) speed.
  • TwistedMechTwistedMech Member Posts: 408
    i have a problem where the sound fx stop working randomly on all objects. Using instruments, it only shows a leak every 4 or 5 seconds but does not seem to run out of memory (i assume the dark blue bar is memory in use). This happens during play of my second level. Anything in Instruments I should focus on using to try and trap the error?
  • JamesBoucherJamesBoucher Member Posts: 433
    Leaks and Object Allocation are the two main things. They kinda go hand and hand. Object Allocation should go down as objects get released(destroyed). I do not see Objects Allocation ever go down in any of my GS apps. Basically if it keeps going up high enough it will crash. There are things you can do to slow this down. The main way is to start by having fewer images and spawning fewer actors.

    As for the memory leaks, this is a GS issue that they need to fix.
Sign In or Register to comment.