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 Application Heap

RAM. Developers nowadays are used to having lots of it, and a virtual machine capable of using as much of it as exists (and more, given swap files and page files).

“Graybeards” — like the author of this book — distinctly remember a time when we had 16KB of RAM and were happy for it. Such graybeards would also appreciate it if you would get off their respective lawns.

Android comes somewhere in the middle. We have orders of magnitude more RAM than, say, the TRS-80 Model III. We do not have as much RAM as does the modern notebook, let alone a Web server. As such, it is easy to run out of RAM if you do not take sufficient care.

There are two facets of memory issues with Android:

This part of the book examines memory-related issues, with this chapter focusing on the application heap. Another chapter will deal with system RAM issues. These are not to be confused with any memory-related issues inherent to graybeards.

Prerequisites

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.

You Are in a Heap of Trouble

The preview of this section was accidentally identified as an Android 'tasty treat' by the Cookie Monster.

Determining Your Heap Size At Runtime

The preview of this section will not appear here for a while, due to a time machine mishap.

Fragments of Memory

The preview of this section left for Hollywood to appear in a reality TV show.

Getting a Trim

The preview of this section is en route to Mars.

Warning: Contains Graphic Images

The preview of this section is sleeping in.

Releasing SQLite Memory

The preview of this section is in an invisible, microscopic font.

Cheating

The preview of this section will not appear here for a while, due to a time machine mishap.

The 1MB IPC Transaction Limit

The preview of this section is in the process of being translated from its native Klingon.