![Page 1: Effective Handling of Low Memory Scenarios in Android · Aakash tablet, with RAM 512MB.) Low Memory Killer in Android Group Name oom _Adj Threshold Minfree Thresholds Foreground 0](https://reader036.vdocuments.us/reader036/viewer/2022070823/5f29b01c28b50e4da94639fe/html5/thumbnails/1.jpg)
Effective Handling of Low Memory Scenarios in Android
Presented By:
Rajesh ProdduturiM.Tech, CSE
IITB
![Page 2: Effective Handling of Low Memory Scenarios in Android · Aakash tablet, with RAM 512MB.) Low Memory Killer in Android Group Name oom _Adj Threshold Minfree Thresholds Foreground 0](https://reader036.vdocuments.us/reader036/viewer/2022070823/5f29b01c28b50e4da94639fe/html5/thumbnails/2.jpg)
• Objective
• Process Management in Android
• Effective Memory Management– Telephone Hardware Checking
– Improved Activity Manager Service
• Low Memory Killer in Android– How does Low Memory Killer work
– Problems in Low Memory Killer
• Conclusion
Agenda
![Page 3: Effective Handling of Low Memory Scenarios in Android · Aakash tablet, with RAM 512MB.) Low Memory Killer in Android Group Name oom _Adj Threshold Minfree Thresholds Foreground 0](https://reader036.vdocuments.us/reader036/viewer/2022070823/5f29b01c28b50e4da94639fe/html5/thumbnails/3.jpg)
In low memory scenarios, low memory killer and Activity Manager kill some of the applications in the system.
• Don’t kill applications, in which user interesting
• Improve speed of device
• Increase memory utilization
Objective
![Page 4: Effective Handling of Low Memory Scenarios in Android · Aakash tablet, with RAM 512MB.) Low Memory Killer in Android Group Name oom _Adj Threshold Minfree Thresholds Foreground 0](https://reader036.vdocuments.us/reader036/viewer/2022070823/5f29b01c28b50e4da94639fe/html5/thumbnails/4.jpg)
Classification of Processes
• Foreground(active) - user currently focused.
• visible process - Bounded to foreground process.
Process Management in Android
![Page 5: Effective Handling of Low Memory Scenarios in Android · Aakash tablet, with RAM 512MB.) Low Memory Killer in Android Group Name oom _Adj Threshold Minfree Thresholds Foreground 0](https://reader036.vdocuments.us/reader036/viewer/2022070823/5f29b01c28b50e4da94639fe/html5/thumbnails/5.jpg)
Classification of Processes
• Service Process - Running on background (playing music).
• Hidden Process - which is not visible(background).
Process Management in Android
![Page 6: Effective Handling of Low Memory Scenarios in Android · Aakash tablet, with RAM 512MB.) Low Memory Killer in Android Group Name oom _Adj Threshold Minfree Thresholds Foreground 0](https://reader036.vdocuments.us/reader036/viewer/2022070823/5f29b01c28b50e4da94639fe/html5/thumbnails/6.jpg)
Classification of Processes:
• Content Provider - Provides structural data (contacts)
• Empty process which was already terminated. It is still present in main memory.
Process Management in Android
![Page 7: Effective Handling of Low Memory Scenarios in Android · Aakash tablet, with RAM 512MB.) Low Memory Killer in Android Group Name oom _Adj Threshold Minfree Thresholds Foreground 0](https://reader036.vdocuments.us/reader036/viewer/2022070823/5f29b01c28b50e4da94639fe/html5/thumbnails/7.jpg)
Different
Groups
of Apps
in RAM
Process Management in Android
![Page 8: Effective Handling of Low Memory Scenarios in Android · Aakash tablet, with RAM 512MB.) Low Memory Killer in Android Group Name oom _Adj Threshold Minfree Thresholds Foreground 0](https://reader036.vdocuments.us/reader036/viewer/2022070823/5f29b01c28b50e4da94639fe/html5/thumbnails/8.jpg)
• Reduce load time, power consumption
Advantages of Empty Applications
![Page 9: Effective Handling of Low Memory Scenarios in Android · Aakash tablet, with RAM 512MB.) Low Memory Killer in Android Group Name oom _Adj Threshold Minfree Thresholds Foreground 0](https://reader036.vdocuments.us/reader036/viewer/2022070823/5f29b01c28b50e4da94639fe/html5/thumbnails/9.jpg)
• Low free memory
• Too much off Empty Apps increases load time for Apps which are not there in RAM
Disadvantages of Empty Applications
![Page 10: Effective Handling of Low Memory Scenarios in Android · Aakash tablet, with RAM 512MB.) Low Memory Killer in Android Group Name oom _Adj Threshold Minfree Thresholds Foreground 0](https://reader036.vdocuments.us/reader036/viewer/2022070823/5f29b01c28b50e4da94639fe/html5/thumbnails/10.jpg)
• Loading Services during Booting
Effective Memory Management
![Page 11: Effective Handling of Low Memory Scenarios in Android · Aakash tablet, with RAM 512MB.) Low Memory Killer in Android Group Name oom _Adj Threshold Minfree Thresholds Foreground 0](https://reader036.vdocuments.us/reader036/viewer/2022070823/5f29b01c28b50e4da94639fe/html5/thumbnails/11.jpg)
List of
Phone
Related
Apps
Loaded
in RAM
Effective Memory Management
![Page 12: Effective Handling of Low Memory Scenarios in Android · Aakash tablet, with RAM 512MB.) Low Memory Killer in Android Group Name oom _Adj Threshold Minfree Thresholds Foreground 0](https://reader036.vdocuments.us/reader036/viewer/2022070823/5f29b01c28b50e4da94639fe/html5/thumbnails/12.jpg)
• Remove Phone Related Apps from RAM
Effective Memory Management
![Page 13: Effective Handling of Low Memory Scenarios in Android · Aakash tablet, with RAM 512MB.) Low Memory Killer in Android Group Name oom _Adj Threshold Minfree Thresholds Foreground 0](https://reader036.vdocuments.us/reader036/viewer/2022070823/5f29b01c28b50e4da94639fe/html5/thumbnails/13.jpg)
Functionality of Activity Manager Service
• Launching Applications
• Updating Application status
• Killing Applications
Effective Memory Management
![Page 14: Effective Handling of Low Memory Scenarios in Android · Aakash tablet, with RAM 512MB.) Low Memory Killer in Android Group Name oom _Adj Threshold Minfree Thresholds Foreground 0](https://reader036.vdocuments.us/reader036/viewer/2022070823/5f29b01c28b50e4da94639fe/html5/thumbnails/14.jpg)
List of
Apps
Loaded
into RAM
By
Activity
Manager
Service
Effective Memory Management
![Page 15: Effective Handling of Low Memory Scenarios in Android · Aakash tablet, with RAM 512MB.) Low Memory Killer in Android Group Name oom _Adj Threshold Minfree Thresholds Foreground 0](https://reader036.vdocuments.us/reader036/viewer/2022070823/5f29b01c28b50e4da94639fe/html5/thumbnails/15.jpg)
List of
Apps
Loaded
into RAM
By
Activity
Manager
Service
Effective Memory Management
![Page 16: Effective Handling of Low Memory Scenarios in Android · Aakash tablet, with RAM 512MB.) Low Memory Killer in Android Group Name oom _Adj Threshold Minfree Thresholds Foreground 0](https://reader036.vdocuments.us/reader036/viewer/2022070823/5f29b01c28b50e4da94639fe/html5/thumbnails/16.jpg)
• Permissions needed to load an App during booting
Effective Memory Management
< application android:persistent=”true” >
< uses-permission android:name=“android.permission. RECEIVE _BOOT_COMPLETED” >
![Page 17: Effective Handling of Low Memory Scenarios in Android · Aakash tablet, with RAM 512MB.) Low Memory Killer in Android Group Name oom _Adj Threshold Minfree Thresholds Foreground 0](https://reader036.vdocuments.us/reader036/viewer/2022070823/5f29b01c28b50e4da94639fe/html5/thumbnails/17.jpg)
• How can we improve speed and reduce page faults
Effective Memory Management
Improved Activity Manager Service {1. Maintain Log history of Apps2. Preload user interesting Apps after
boot based on time3. Increase priority of user interesting
Apps during runtime}}
![Page 18: Effective Handling of Low Memory Scenarios in Android · Aakash tablet, with RAM 512MB.) Low Memory Killer in Android Group Name oom _Adj Threshold Minfree Thresholds Foreground 0](https://reader036.vdocuments.us/reader036/viewer/2022070823/5f29b01c28b50e4da94639fe/html5/thumbnails/18.jpg)
• How does Low Memory Killer work (Values in below table are taken from
Aakash tablet, with RAM 512MB.)
Low Memory Killer in Android
Group Name oom _Adj Threshold Minfree Thresholds
Foreground 0 1MB
Visible 1 3MB
Secondary 2 4MB
Hidden 4 7MB
Content Provider 9 8MB
Empty 15 10MB
![Page 19: Effective Handling of Low Memory Scenarios in Android · Aakash tablet, with RAM 512MB.) Low Memory Killer in Android Group Name oom _Adj Threshold Minfree Thresholds Foreground 0](https://reader036.vdocuments.us/reader036/viewer/2022070823/5f29b01c28b50e4da94639fe/html5/thumbnails/19.jpg)
• Low Minfree Thresholds
Low Memory Killer in Android
Pros Cons
Improves degree of multi programming
IncreasesLag time
Reduces response time of frequently accessed applications
Increasesnumber ofpage faults
![Page 20: Effective Handling of Low Memory Scenarios in Android · Aakash tablet, with RAM 512MB.) Low Memory Killer in Android Group Name oom _Adj Threshold Minfree Thresholds Foreground 0](https://reader036.vdocuments.us/reader036/viewer/2022070823/5f29b01c28b50e4da94639fe/html5/thumbnails/20.jpg)
• High Minfree Thresholds
Low Memory Killer in Android
Pros Cons
Decreases Lag time
Decreases degree of multi programming
Less number ofpage faults
Increases response time of frequently accessed applications
![Page 21: Effective Handling of Low Memory Scenarios in Android · Aakash tablet, with RAM 512MB.) Low Memory Killer in Android Group Name oom _Adj Threshold Minfree Thresholds Foreground 0](https://reader036.vdocuments.us/reader036/viewer/2022070823/5f29b01c28b50e4da94639fe/html5/thumbnails/21.jpg)
• Complaint from Android users[4]
Default minfree values in their system, do not give good performance
• Static minfree values suitable in not all the situations.
Problems in Low Memory Killer in Android
![Page 22: Effective Handling of Low Memory Scenarios in Android · Aakash tablet, with RAM 512MB.) Low Memory Killer in Android Group Name oom _Adj Threshold Minfree Thresholds Foreground 0](https://reader036.vdocuments.us/reader036/viewer/2022070823/5f29b01c28b50e4da94639fe/html5/thumbnails/22.jpg)
Compressed Cache
CPU
Swap Space
SD Card
Swap InCompress
Swap OutDecompress
Remaining RAM
RAM
![Page 23: Effective Handling of Low Memory Scenarios in Android · Aakash tablet, with RAM 512MB.) Low Memory Killer in Android Group Name oom _Adj Threshold Minfree Thresholds Foreground 0](https://reader036.vdocuments.us/reader036/viewer/2022070823/5f29b01c28b50e4da94639fe/html5/thumbnails/23.jpg)
• Improves user experience
• Decreases load time of applications.
• Achieves effective memory utilization (not too much of free memory and less page faults)
Conclusions
![Page 24: Effective Handling of Low Memory Scenarios in Android · Aakash tablet, with RAM 512MB.) Low Memory Killer in Android Group Name oom _Adj Threshold Minfree Thresholds Foreground 0](https://reader036.vdocuments.us/reader036/viewer/2022070823/5f29b01c28b50e4da94639fe/html5/thumbnails/24.jpg)
1. Daniel P. Bovet, Marco Cesati . ”Understanding the Linux Kernel, 3rd Edition” Publisher: O’Reilly , Pub Date: November 2005 , ISBN: 0-596-00565-2 , Pages:942.
2. Processes and Threads, Android developers wiki. Available at: http://developer.android.com/guide/components/processes-and-threads.html
3. Android Kernel Features, elinux wiki. Available at:
http://elinux.org/Android Kernel Features
References
![Page 25: Effective Handling of Low Memory Scenarios in Android · Aakash tablet, with RAM 512MB.) Low Memory Killer in Android Group Name oom _Adj Threshold Minfree Thresholds Foreground 0](https://reader036.vdocuments.us/reader036/viewer/2022070823/5f29b01c28b50e4da94639fe/html5/thumbnails/25.jpg)
4. How to configure Android’s internal taskkiller, xdadevelopers wiki. Available at: http://forum.xda-developers.com/showthread.php?t=622666
5. CompCache , Compressed Cache for linux Available at: http://code.google.com/p/compcache/
6. Linux Cross Reference. Available at:
http://lxr.free-electrons.com/source/drivers/staging/android/lowmemorykiller.c
References