Nicholost
03-08-2012, 12:56 PM
Preface
We've all experienced this at one point or another. You do some event (rob someone, open the rivals list, complete a game mission, etc.) and Bam!, the Crime City app crashes. Of course, Murphy is there to ensure it occurs at the worst possible time (e.g. finally find a no-banking player). The cause is likely that Crime City is asking for more runtime memory than your device has available to provide it. CC loses that memory battle and the device shuts the app down. There may be other causes, but in my experience, cashes tend to be tied to events (clicks and new windows).
Analysis
The iPod Touch (3G & 4G) and iPhone (3GS) come with only 256MB of runtime memory, or RAM. (Later iPhones have 512MB.) Don't confuse this with physical memory (i.e. 8GB, 16GB or 32GB). When idle, my iPod sits at around 110MB of free memory. After I start up Crime City, play for a bit, then quickly switch over to my memory usage app, I see that my available memory is about 75MB. That quickly grows to about 105MB as memory is freed up by CC closing. There may be more scientific approaches to monitoring memory usage while apps are running, but this is what I have to work with, so bear with me.
As you use your device, apps take memory while they are in use and release that memory when they close, but many times those amounts are not equal. These are called memory leaks. Almost all software has them to some degree, no matter how well written they are. If it has been a long time since your last restart, it is likely that apps, CC included, have taken and not released a good portion of your memory. This leaves you with a much smaller amount of free memory for apps to use. Since, CC is probably not a lightweight app (based on the graphics, level of detail, its many windows, and the number of server calls it makes), it probably requires a hefty chunk of memory to run. If CC is using most of the available memory, it is at risk of crashing due to an out of memory event. That’s my guess anyway. I don’t have access to source code or some of the professional tools that would shine light on this.
Fix
This is going to sound stupid, but the first thing you should do it restart your device. Seriously. This will clear any memory that been mistakenly earmarked as in use. You can do this by holding the on/off button and home button for 3 seconds, then swipe the Shut Down slide bar. Once the device is shutdown, turn it on using the on/off button.
Another method is to download one of many memory management apps to manually forcefully free up memory. I personally use SYS Activity Manager by Appsware. It works pretty well and does free up additional memory, but it’s still not as effective as a restart.
A neat trick that not many people know of is that you can forcefully terminate apps. This is different from closing the app from the recently accessed app list. Instead, with the app you want to terminate running, hold on/off button and home until you see the shutdown screen (~3 seconds). Now hold down home for ~8 seconds. The screen should flash and the app should close. I’m not sure what the effects of doing this are, so you may want to use this methods sparingly and in worst case scenarios.
Conclusion
I did my last restart over a week ago and have started using SYS Activity Manager every other day since then. I have experienced zero crashes at all. That’s remarkable considering CC used to crash every 8-10 minutes of use (I actually used to time it because it was so frequent).
Notes:
These findings were based of experiences with CC v2.0.2 and v2.2. Later CC releases may not be as susceptible to crashes as these releases. Technically, it has more to do with your device's free memory and less to do with the app anyway.
While I am a software developer, I am not a hardware guy, nor do I care for Apple products or claim to know much about them. If any of the above information is wrong, let me know and I will correct it.
We've all experienced this at one point or another. You do some event (rob someone, open the rivals list, complete a game mission, etc.) and Bam!, the Crime City app crashes. Of course, Murphy is there to ensure it occurs at the worst possible time (e.g. finally find a no-banking player). The cause is likely that Crime City is asking for more runtime memory than your device has available to provide it. CC loses that memory battle and the device shuts the app down. There may be other causes, but in my experience, cashes tend to be tied to events (clicks and new windows).
Analysis
The iPod Touch (3G & 4G) and iPhone (3GS) come with only 256MB of runtime memory, or RAM. (Later iPhones have 512MB.) Don't confuse this with physical memory (i.e. 8GB, 16GB or 32GB). When idle, my iPod sits at around 110MB of free memory. After I start up Crime City, play for a bit, then quickly switch over to my memory usage app, I see that my available memory is about 75MB. That quickly grows to about 105MB as memory is freed up by CC closing. There may be more scientific approaches to monitoring memory usage while apps are running, but this is what I have to work with, so bear with me.
As you use your device, apps take memory while they are in use and release that memory when they close, but many times those amounts are not equal. These are called memory leaks. Almost all software has them to some degree, no matter how well written they are. If it has been a long time since your last restart, it is likely that apps, CC included, have taken and not released a good portion of your memory. This leaves you with a much smaller amount of free memory for apps to use. Since, CC is probably not a lightweight app (based on the graphics, level of detail, its many windows, and the number of server calls it makes), it probably requires a hefty chunk of memory to run. If CC is using most of the available memory, it is at risk of crashing due to an out of memory event. That’s my guess anyway. I don’t have access to source code or some of the professional tools that would shine light on this.
Fix
This is going to sound stupid, but the first thing you should do it restart your device. Seriously. This will clear any memory that been mistakenly earmarked as in use. You can do this by holding the on/off button and home button for 3 seconds, then swipe the Shut Down slide bar. Once the device is shutdown, turn it on using the on/off button.
Another method is to download one of many memory management apps to manually forcefully free up memory. I personally use SYS Activity Manager by Appsware. It works pretty well and does free up additional memory, but it’s still not as effective as a restart.
A neat trick that not many people know of is that you can forcefully terminate apps. This is different from closing the app from the recently accessed app list. Instead, with the app you want to terminate running, hold on/off button and home until you see the shutdown screen (~3 seconds). Now hold down home for ~8 seconds. The screen should flash and the app should close. I’m not sure what the effects of doing this are, so you may want to use this methods sparingly and in worst case scenarios.
Conclusion
I did my last restart over a week ago and have started using SYS Activity Manager every other day since then. I have experienced zero crashes at all. That’s remarkable considering CC used to crash every 8-10 minutes of use (I actually used to time it because it was so frequent).
Notes:
These findings were based of experiences with CC v2.0.2 and v2.2. Later CC releases may not be as susceptible to crashes as these releases. Technically, it has more to do with your device's free memory and less to do with the app anyway.
While I am a software developer, I am not a hardware guy, nor do I care for Apple products or claim to know much about them. If any of the above information is wrong, let me know and I will correct it.