Update background apps' oom_adj adjustment algorithm
[Titile] Update background apps' oom_adj adjustment algorithm.
[Issue#] TDIS-1148 (https://tizendev.org/bugs/browse/TDIS-1148)
[Problem] N/A
[Cause]
There are two tasks system-server need to do when an application goes
to background:
1. Update older apps' oom_adj values to make them more vulnerable to OOM killers;
2. Kill the oldest foreground app when background apps number exceeds the limitation.
Previous algorithm will increase older apps' oom_adj whenever an app goes to
background and there's a oom_adj == 1 app exists.
[Solution]
1. Utilizes bucket sort to sort existing background apps then update their oom_adj
values one by one.
2. Kill remain apps when the limitation is reached.
Change-Id: I166b11a91d05b39704686059f633cc725413974d