I have an Android phone that has 3gb of RAM available it uses nearly 1.4gb at boot up and max of 2gb on using chrome ,WhatsApp and Samsung Internet and when I switch to recent apps they restart and that I hate because despite of having more than enough RAM my Android is unable to utilize it .Please help me in getting better ram management.
You don't have control over the amount of memory committed by the OS.
Android has a Low Memory Killer (LMK)that will go around killing processes that have a low score.
The score is determined by a variety of things but in general:
- Process with Activity in forground
- Process with a foreground service
- Process with service
- Process with Activity in background
- Empty process (none of the above)
So the low memory killer starting with the lowest score and kill their process to reclaim memory.
Note: that this is the Android Low Memory Killer there is a Linux Out of Memory Killer also, the the LMK will hopefully means it doesn't come to that because either might kill something critical.
Anyways the settings for the LMK are setup when the firmware is built and not updatable by users.
Note that if you were able to use 100% memory that would be bad. Because it would cause Android to thrash any time a new process needed to be created so your performance would be really bad.
So it's safe to bet that you are current working at pretty close to peak performance. They do tune these things before shipping them.