CPU Usage and Memory Issues

GamexcbGamexcb Member Posts: 179
edited November -1 in Tech Support
I just monitored my latest game with apple's performance tools to see exactly why my game kept crashing. I found that when the game starts the CPU is overloaded and goes straight to 99.7% to 100% it runs really slow but crashes, of course, when it hits 100%.
When I measured memory it was also a mess, it always allocated too much than my iPod had. This is also a major contributor to the crashing issues.
The Gamesalad team needs to fix the way the GS creator uses memory and the CPU.
-Gamexcb

Comments

  • firemaplegamesfiremaplegames Member Posts: 3,211
    Do you have too many actors spawning or too many timers?

    I have found that having more than 15 or so actors in a Scene would cause major slowdown on my 3G.

    Timers can be especially rough on the processor.

    I was able to recode my project so the ram usage never went above 15MB...
    If it gets near 60MB, you'll start to have crashing issues.

    Also make sure all of images fit nicely into the powers of 2 rule, and that you're not wasting memory there.

    The memory on these devices is very precious.
  • GamexcbGamexcb Member Posts: 179
    On the 3G too? Wow...
    Yeah I understand how to optimize I have coded with C and Objective-C and used Xcode for development, so optimizing isn't a new thing to me.
    Yeah my game is getting really big, I found that about 6 to 8 moving actors at a time is the limit for the iPod Touch. The only thing that the GS Team would need to add is behaviors for manual memory allocation and release.
    -Gamexcb
  • JamesBoucherJamesBoucher Member Posts: 433
    My first game I had lots of memory problems. I used instruments and found that my game would crash within 20 seconds. My issue was using behaviors without using a timer. What I think was happening was the behaviors created times (real time) and filling up memory. By using a timer with the behavior, it gives time for the timers to be released.

    Also you need to remove any images that you have in you project but not using. Simplify you background images also helps.

    My Rats Of The Maze game in the final level has about 70 actors with 17 moving rats after one moving tank.

    I don't think GS is going to make any behaviors for allocation and release of memory. I could be wrong!
  • GamexcbGamexcb Member Posts: 179
    Well for people who do not want to manage memory manually, GS could make a behavior that would "Auto-Manage" the actors memory.
    This would allow beginners to still create and professionals to mix using auto and manual.
  • mosaicmosaic Member Posts: 3
    Can anyone tell me what is the "powers of 2 rule"? I've read this a few other time on the web, but still have no idea what it is.
  • quantumsheepquantumsheep Member Posts: 8,188
    You should not be posting today of all days, Mr. Monkey! Off to funner things for you! :)

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • TobyToby Member Posts: 478
    Agreed!
Sign In or Register to comment.