Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,161,279 members, 7,846,281 topics. Date: Friday, 31 May 2024 at 01:23 PM

How Does Android Manage RAM? - Phones - Nairaland

Nairaland Forum / Science/Technology / Phones / How Does Android Manage RAM? (329 Views)

Why Does Android Phones Consume So Much Internal Storage? / How Does Android Feel Without Google? / What Data Does Android Back Up Automatically? (2) (3) (4)

(1) (Reply)

How Does Android Manage RAM? by atheistandproud(m): 7:00am On May 26, 2022
Android is the most widely used operating system in the world. Since it’s inception in 2007, it has gone on to dominate the market and conquer the world. In this post, we are going to look at how Android manages RAM.

RAM is a very common subject of discussion these days but it is not very understood by a lot of people. RAM is a very fast type of memory that sits very close to the SoC. It serves as a space for the CPU core to process apps as well do multitasking.

The smartphone’s operating system is usually in charge of RAM management and Android is no different.


https://www.youtube.com/watch?v=B8vmwWuresM

How Android Manages RAM

Android memory management is done by Android Run Time (ART). The ART replaced the older Dalvik Virtual Machine (DVM) which used to oversee how Android ran on smartphones.The ART was a great improvement over the older DVM. ART improved system efficiency and reduced battery consumption. In addition, ART improved app loading times and RAM management.

ART helps Android manage RAM efficiently using the following methods:

Paging
Memory mapping
Memory allocation
Caching and app switching
Garbage collection


Paging and Memory mapping
Android divides RAM into pages and each page is about 4KB in size. An app like WhatsApp for example may only need 30 pages or 120KB of RAM. An App like PES, PUBG or Chrome may require more than Three hundred and seventy five thousand pages or 1.5GB of RAM.

Memory mapping refers to how the software or virtual memory locations is mapped on to the physical memory (RAM). This is done by what is known as a memory management unit. It maps all software locations of memory on to the hardware and then hands over a virtual address book to the OS.

See: RAM management

Memory allocation
Memory allocation refers to how ART shares memory (RAM space) amongst competing apps.

ART does not allocate full RAM pages to apps because apps may not use all of the space on the page. This would lead to wasted pages. What is does instead, is that it shares RAM pages between apps. This is a much more efficient way to allocate memory as it prevents memory fragmentation.

ART also puts a restriction on the amount of RAM space that can be allocated to any single app. This is usually around 4GB but it can vary depending on the size of the RAM. This is to ensure no one single app uses up RAM at the detriment of the others as well as general system functions.

Read: Causes of poor RAM management

Caching and App switching
When a user is finished with an app and switches to a different one, the ART does not immediately kill it. What it does is that it keeps the app process in a cache. It may also choose to keep this cache on the RAM or swap it to the zRAM or off the RAM to a virtual memory storage.

When the app is needed, ART simply moves the app from the cache and back into the RAM. Simple, efficient and effective.

Read: Multitasking and RAM Management on smartphones

Garbage collection
Garbage collection refers to the way that an OS recovers memory from app processes that are no longer in use.ART has ways of automatically retrieving space from app processes that have been killed or cached. It would then allocate this freed space to newer apps and thus improve system performance.

https://inquisitiveuniverse.com/2022/05/25/how-android-manages-ram/

2 Likes 1 Share

(1) (Reply)

Tecno Camon 19 Price And Specifications / Tecno Camon 19 Pro 5g Vs Pova 5g Comparison / These Networks Are Frustrating My Efforts

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 11
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.