The following is the first few sections of a chapter from The Busy Coder's Guide to Android Development, plus headings for the remaining major sections, to give you an idea about the content of the chapter.

Issues with System RAM

Your application heap is your little corner of the system RAM on the device that you focus on in your Java development. However, there are other things that you might do that consume system RAM, such as use the NDK to add C/C++ code to your app. How much system RAM you consume overall will have an impact on user acceptance of your app, as the more RAM you use, the more frequently the user’s other apps are terminated to make room for you. And, as a result, the more system RAM you use, the more likely it is that your process will be terminated when you are not in the foreground, to free up RAM for other apps. Hence, while system RAM is not something you necessarily think about as often as you do your application heap, it is something that you should pay attention to, at least a little bit.

This chapter will explain a bit more about the relationship between your app and system RAM, how you can measure how much system RAM your app is consuming, and how you can reduce that consumption.


Understanding this chapter requires that you have read the core chapters and understand how Android apps are set up and operate, particularly the chapter on Android’s process model. Reading the chapter on issues with the application heap is also a good idea.

Can’t We All Just Get Along?

The preview of this section took that left turn at Albuquerque.

Contributors to System RAM Consumption

The preview of this section was lost in the sofa cushions.

Measuring System RAM Consumption: Tools

The preview of this section was last seen in the Bermuda Triangle.

Measuring System RAM Consumption: Runtime

The preview of this section is en route to Mars.

Learn To Let Go (Of Your Heap)

The preview of this section was last seen in the Bermuda Triangle.