Memory management in Android
Let's discuss the memory management system in Android. It has a direct effect on the game development process. Games are treated like applications in Android. Very often, developers face memory issues in both the runtime and minimized states of the game. There are three main topics to discuss to understand the working principles:
Shared application memory
Memory allocation and deallocation
Application memory distribution
Shared application memory
Android uses the Linux kernel, and Linux uses "shared" pages to share the same memory segment within running processes or services. For example, Android often shares the "code" memory within processes. Very often, external libraries and JVM's executable code memory can be safely shared across processes without creating a deadlock. Data pages could be shared temporarily between processes, until a process modifies the shared memory.
Android allocates dedicated memory for each application or process. This is called private memory...