Is it normal that more than half of RAM use can't be accounted for?


Question

I have a Samsung Galaxy phone and it typically says something like 705MB used 101MB free. This is a phone with like no apps except what sprint put on there. I've added up the running services and it comes to 279MB of RAM use. I can't figure out where the extra 400MB usage is coming from.


Answer

Pretty much. As Lie Ryan mentioned in his post:



Most smart phones are designed as a System-on-Chip; which means that
the CPU, RAM, GPU, device controllers, etc are all in a single chip.



The physical memory chip capacity is shared between different parts of the hardware (SoC). So the amount of memory available to your applications is what's left from the original allocation.


In addition, just like any Linux system, Android is optimised to use as much RAM as possible, because that's how it was designed to work.


Furthermore, android system has a built in memory management system called Minifree. Basically operations like memory allocations to applications are done for example instructing the system how much RAM to leave free and available, cacheing 'often used' apps in memory, etc.


Here is the basic categories of minifree memory allocation to applications:



Foreground App: This is the application currently on the screen, and
running


Visible App: This is an application that is open, and running in the
background because it's still doing something


Secondary Server: This is a process (a service that an application
needs) this is alive and ready in case it's needed to do something e.g

launcher, UI etc.


Hidden Application: This is a process that sits idle (but still alive)
in case it's needed by an app that's alive and running


Content Provider: This is apps that provide data (content) to the
system. If they are alive, they can refresh and provide the content
they are supposed to at the set interval. If you kill them, they can't
of course. e.g Contacts, calender etc.


Empty App: These are apps that you have opened, but are done with
them. When an activity is ended, instead of killing it off Android
keeps the application in memory so that opening them again is a faster
process.



Given this whole range of minifree allocations, its possible the application may not be visible but busy carrying out useful tasks requiring RAM, also even when you've killed a given app, there are high chances is stored as an 'empty app' (meaning its lodaded into RAM so that executing the same app again will be fast).


All this occurs at the expense of overall RAM on board and as a result you always get a lower RAM reading than anticipated, since mostly is is cached as explained above.


While you can reset or tweak default minifree values, I believe seeing lower RAM readings when not using lots of applications is good since you are guaranteed execution will always be fast than starting to load an application into memory every time.


Basic notes



  • some RAM is shared between hardware

  • some RAM is allocated to hidden apps, content providers, empty apps which may not be visible in usage statistics, but its still important for improving device performance.


References



Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes