yashsingh1/xdaforums huggingface dataset:
[Xperia SP General] mrhnet:
[Highlight]An interesting observation...[/highlight]

Many of us refer to 'Settings>Apps>Running' to see how much free RAM is available at a particular moment. Generally we believed that it shows the correct value. But, some observations makes that value doubtful. E.g: This value doesn't tally with /proc/meminfo values. Furthermore, 'Free RAM' indicated by other apps at times are totally different.

(1).CoolTool - 121 MB

(2).meminfo (watch cat /proc/meminfo) - Looks compatible with cooltool value.

(3). Android says - 23MB!!??

**(all 3 values were updating realtime..)

Sometimes it goes the other way:

(gave time to settle down of course)

Any thoughts?? Does anyone experience like this or only me? :confused:
[Xperia SP General] mrhnet:
Just in case..
[Xperia SP General] androcheck:
Hi [MENTION=4414423]mrhnet[/MENTION]: I got pinged by your mention of my username. Thank you for this valuable thread! It's so important for xda having people around which actually explain and give knowledge to others! This is how a community should work! Great work! :good: :)

P.S.: Also thanks for giving me credit. That's not to be taken for granted. When I search the web for the unfortunate typo in my posting "on Android the current forefround application" I find a lot of resources which simply copied my words and often did not give any credit. So I appreciate this very much! :)
[Xperia SP General] mrhnet:
[MENTION=2199154]androcheck[/MENTION]

Thanks for the encouragement.. :)
[Xperia SP General] Levered:
nice tutorial with full descriptions...great..:good:
[Xperia SP General] mrjraider:
This is wonderfull! I will add this to the tutorial Index this weekend :)
[Xperia SP General] mrhnet:
Thanks. That's nice of you :)
[Xperia SP General] pavapizza:
thx u very much for the detailed explanation, gonna try ur recommended values later
[Xperia SP General] deathviper:
great bro can be a sticky thread
[Xperia SP General] zeppelinrox:
Nice thread dude.

Now I'm glad that I had patience with your patching issues lol

However I don't think I have the patience to go into every tiny detail which is why I link to [MENTION=2199154]androcheck[/MENTION] 's thread in my original Supercharger OP (which is now post #3)

And you may find useful the new tool that I'm finally on the verge of releasing...

Yeah don't you hate that... personally I'm to lazy to copy other people's efforts and rather link to them while doing something new.

No sense in retreading a good tire ;)
[Xperia SP General] androcheck:
Thanks. :)

I didn't take any offense, if not I would have written it, someone else would have. In the end the knowledge has spread. :)
[Xperia SP General] mrhnet:
[MENTION=3357461]zeppelinrox[/MENTION]

I'm so glad about your comments on this thread. Thanks :)

Awaiting for your new works.. as always.. ;)
[Xperia SP General] zeppelinrox:
Soon.

It's done but gotta write up an OP ;)

Edit: Done http://goo.gl/9H58pS
[Xperia SP General] Lajbymester:
This is a great thread, you've explained everything very well. :good:

In my experience, RAM management works best if I set very low LMK values, like this. Anything higher means processes will get closed sooner.

Multitasking is good with this, not very good, though, because this is a Sony ROM, but still way better than higher values.

But be warned, using these values on stock 4.3 made it unstable for me, but it works on stock 4.1 without any problems.

Also, I've read on some sites that Sony will release Kitkat for the SP in June, and Kitkat has ZRAM enabled and also some other memory management-helping changes are made by Google. So I really hope it will be released for our device. ;)

Edit (05.23): Well, it seems after a few days of testing, that these low values don't do anything good. The phone slows down a lot. So, this post might be considered pointless. Anyway, it was a good experiment.
[Xperia SP General] Lajbymester:
I found one thing: in /proc/meminfo it shows more than 200 MB at Cached, but the launcher still redraws when i press Home in Chrome, and sometimes when going back from minfree manager (while chrome is running). So why doesn't the system utilize the Cached memory instead? I see that you, mrhnet, have 78 MB cached on one of the screenshots... Is this some sort of ram management bug in the stock 4.1 or what?
[Xperia SP General] mrhnet:
200mb cached means it's included in "free RAM". But it changes according to RAM demand/usage by apps. (Give "watch cat /proc/meminfo" command [without quotes] in a terminal to see; "watch" command runs what comes after that every 2 seconds). Maybe, by the time you switch from Chrome to terminal, Cached amount might have changed. (I think Chrome is a memory hog btw; haven't used it much).

If you really want to see what was in meminfo while chrome is on, I suggest to "record" meminfo values to a file real-time. Can do like this:

*Open terminal emulator

*go to /sdcard

cd sdcard

*append output of meminfo to a file every 2 seconds

watch cat /proc/meminfo >> memlog.txt

*leave terminal emulator in background and do whatever in chrome. Meminfo values should be recording in the background; terminal is not easily shutdown because it has a notification (apps having a notification saying that it's running has a high priority I think).

*then come back to terminal emulator and do a "ctrl+c" to break the recording (see terminal settings to know what's assigned as ctrl button)

*now you have a memlog.txt file in sdcard with meminfo output every 2 seconds (might look overwhelming :P). If 2 seconds is too frequent, can adjust "watch" command accordingly (eg: watch -n 10 cat /proc/meminfo). Just give "watch" command to see it's usage.

You can go through that file leisurely to see how Cached etc have changed with time. Can filter with "grep" to avoid other gibberish.

Eg:

grep -w Cached: memlog.txt

This command outputs only the "Cached:" line in the file. [Remember: everything is case sensitive in Linux]. You can even write that output to another file for ease (can do for other values also):

grep -w Cached: memlog.txt >> Cached.txt
grep -w MemFree: memlog.txt >> MemFree.txt
grep -w Buffers: memlog.txt >> Buffers.txt

Then can go through these files leisurely to see min/max values. I think you can do lot of things with "grep". A Linux geek might even arrange these data to make a graph! [MENTION=3357461]zeppelinrox[/MENTION] is the man for this I think ;)
[Xperia SP General] Lajbymester:
Thanks for the very detailed reply :D

Actually I was doing the "cat /proc/meminfo" command on the computer using adb on the computer, so switching apps wouldn't interfere. ("watch cat /proc/meminfo" doesn't work for some reason, it doesn't output anything but the actual date). And while looking at Chrome with 2 heavy desktop websites, it was showing ~220 MB at Cached. It doesn't ever go below 180 MB...
[Xperia SP General] mrhnet:
Ok. :D

Dunno exactly what's wrong there.. Just remembered a part from kernel sources I've mentioned in OP:

Maybe part of Cached is "locked"?? Can do a reboot and see whether the situation persists (if not done already).
[Xperia SP General] Lajbymester:
I've done a reboot and it persists. Actually this is not a big problem, I just saw that it uses much cache when I'm using Chrome, but I've read that Chrome kills multitasking even on the Galaxy Nexus, so it's normal. It was just bothering me that cache doesn't free up, but multitasking is alright when using another browser. :)
[Xperia SP General] jancsessz:
Guys pls read what its best LMK values for gaming

Tapatalk-kal küldve az én C5303-el
[Xperia SP General] njstein:
[MENTION=4414423]mrhnet[/MENTION], thank you for posting this tut! A ton of excellent information that every xda member should be required to read! Definitely a re-reader.
[Xperia SP General] pepoluan:
[MENTION=4414423]mrhnet[/MENTION], thanks for the tips! I used your values in Post #2, and I am now a happier dog :cool:

FYI, I'm using eXistenZ Ultra ROM, and deep within the Settings menu, there exist a "Performance Control" app (applet?) that can set minfree values and restore it during boot.

(I'll thank your posts later; I've run up against the 8-thanks-per-day limitation)

.
[Xperia SP General] ramrastus:
hey guys supercharger v6 drain battery ???
[Xperia SP General] mrhnet:
The part of v6 that might affect battery is probably "bullet-proofing apps", I think. Because a script runs in the background. However, I haven't noted extra battery drains during the days I used it.

** btw, better not quote the whole OP.
[Xperia SP General] ramrastus:
i have 500mb ram.. howmuch minfree value ll set to ma device??? (want multitasking amd more free ram)

also in end of build.prop line howmuch apps limit ll set? (70 to 150mb)
[Xperia SP General] mrhnet:
Having both more free ram AND multitasking is a difficult luxury unless having higher RAM. I suggest you to use V6 supercharger script and apply the "calculator" values it suggests. It gives a good balance.

The build.prop setting is working for Xperia SP stock ROMs. Not sure it will have an effect on other phones. However, can test whether it has an effect by noting the app number (eg.#17) which is killed because "no longer needed", indicated in logcat, using "longer" filter [described in OP]. Then can add the build.prop value (70, then 150) and reboot to see whether those killed app no. changes or those "longer" entries disappear. If no change, then probably that build.prop setting doesn't work on your phone.
[Xperia SP General] ramrastus:
okie.. i wanna apply #superchargerv6 script.

but, ma system was repaired. so i can't complete service.jar patches steps.

without service.jar patches superchargerv6 works?
[Xperia SP General] mrhnet:
It works for setting minfrees and other tweaks. Jar patching is needed for "supercharging" oom priorities. So, v6 might say 50% Supercharged without jar patching.
[Xperia SP General] ramrastus:
yup its shows 50% supercharging.

so its working 50% only huh? without jar patching right?
[Xperia SP General] mrhnet:
Jar patching is needed for changing Home launcher and other oom priorities. But with xposed module mentioned in the OP, can make Home launcher stay in memory. If need other benefits of jar patching, can go ahead with it. However, setting minfrees by v6 works well even without jar patching (not that it's working only half).
[Xperia SP General] Kianush:
Hi, I used the app mentioned in OP to make home launcher resident, saved and forced stop xperia home so it will relaunch with new settings but still when Im in album for a little bit time or I open some apps together like viber and messaging and I press home button, home redraws!

any help?!
[Xperia SP General] mrhnet:
Sorry I couldn't reply earlier..

As mentioned in the OP, can see whether making Home "resident" results in oom_adj status change:

Usually Home (eg: nova launcher) stays as a HIDDEN app, so easily killed when RAM goes down..

After making it "resident", it becomes a FOREGROUND app.

*If this is not happening, maybe something wrong with Xposed module setup. If it gets killed even as a FOREGROUND app, maybe the Minfrees are set too high for the FOREGROUND app shutdown (described in the OP). Also, try Greenify to hybernate unnecessary apps. Jar patching is a another option to make Home stay in RAM.

Frankly, now I'm on custom KK ROMs without using any of the tweaks mentioned in the OP and having very good multitasking and free RAM. Available for LBL too. May as well give 'em a try :P
[Xperia SP General] M7mdA7md7sein:
[MENTION=4414423]mrhnet[/MENTION]

Thanks for your tips :D

but I tried those methods with CM12 rom and non of these are working !

used to get it working with previous KK and JB roms...

even the Terminal method, it diplays "access denied" with SU granted of course !

any ideas why or how to fix it ? cause I got tired searching allover the internet and finding nothing !

Thank you :D

Fixed by Mr.Steve :D

enter that code first

chmod 666 <pathtotheminfreesysfsfile>

And then try setting the values again.

Great Thanks to him :D
[Xperia SP General] Tuxedo75:
Hi,

I'm trying to deactivate nfc service and mirrorlink since I don't use that atm, but no way....

Also if deactivated from app menu, I still have that two in memory manager that eats constantly about 80 Mb if ram...

Any tip? I don't want to completely uninstall they...maybe I need in future...
[Xperia SP General] thewild:
Yes, just uninstall them. Make a backup before with TB.

I uninstalled almost all Sony apps, and all the stuff I don't use (mirrorlink, nfc, throw, facebook, timescape, sony camera, albums, movies, etc.), and everything works perfectly. 323MB free RAM after boot (with some apps running in background like pushbullet, hangouts, dropbox...). Also removed a lot of Google related stuff.
[Xperia SP General] Anupam_Dey:
[MENTION=4414423]mrhnet[/MENTION] , I applied very aggressive values 5 ,10, 400 ,400 ,400 ,400 via minfree manager . But even if I minimise gta san andreas (uses 200mb+ ram) ,it does not get killed. Question is , why ?

I use an xperia tipo which has 404 mb of ram.
[Xperia SP General] |>/\nte:
Very nice thread. Just one thing: Will I be able to modify some parameters via the kernel adiutor app (since it has an option for modifying ram management parameters like hidden_app and such stuff manually) and benefit from not closing an app after loading another? Also, I'm open to recommendations (I just checked out the thread).
[Xperia SP General] creative21:
yes, kernel auditor will work fine and you can use it's recommend values
[Xperia SP General] leonardoroza:
Thanks

Enviado de meu Moto G usando Tapatalk
[Xperia SP General] asmat98:
Hello friends. I have a question. In settings>apps>running are running services and cached processes. But there is some space (see pictures) that not shows. So how I can see that "hidden" processes? I want to know what is there, because when I use my phone 5-6 hours after reboot, that space (I showed it in picture) becoming bigger. Thank you.

i.imgur.com/IpolDvM.jpg

i.imgur.com/5m2DTFq.jpg

(sorry, I'm new in xda, I cant post links)
[Xperia SP General] Tomoms:
It's normal. That's used space just like the other portion of the blue bar. That kind of blue curly bracket is misleading.
[Xperia SP General] NVardan:
Aren't there any apps which would be able to show that space used by system processes and maybe even terminate if needed?
[Xperia SP General] Iqballoon:
nice guide, will try later

might help my freezing problem *crossed finger*
[Xperia SP General] torhect:
Hey nice article but I want to know something I have a note 5 you know this machine is packing a 4gb I'm also running marsmallow custom rom but the problem is that I can only open 20 apps after that lkm minfree start killing it but I know this thing can handle more apps I also made build prop changes you mentioned but nothing happened and I have tried to change minfree on sys/module/parameters/minfree but after I change it when I try to apply the changes the values revert to the stock values:( .. I have downloaded a tons 9f minfree memory apps but none of then worked out for me!! Any suggestions my friend would be great :)

---------- Post added at 10:49 PM ---------- Previous post was at 10:42 PM ----------

For me doesn't work I have a note 5 running latest marsmallow firmware and when I try to change it , the values revert to the stock one I don't know why!!
[Xperia SP General] tweakradje:
Small addendum

First not all devices have the same OOM configuration. Post boot maybe some scripts may change the default Android settings.

Therefore you need to check some things to make sure what you are doing.

Android 2.x had OOM but different config. This is for Android 4.x Please correct me if I am wrong :)

First get your OOM ADJ levels right:

dumpsys activity oom

OOM levels:
SYSTEM_ADJ: -16
PERSISTENT_PROC_ADJ: -12
FOREGROUND_APP_ADJ: 0
VISIBLE_APP_ADJ: 1
PERCEPTIBLE_APP_ADJ: 2
HEAVY_WEIGHT_APP_ADJ: 3
BACKUP_APP_ADJ: 4
SERVICE_ADJ: 5
HOME_APP_ADJ: 6
PREVIOUS_APP_ADJ: 7
SERVICE_B_ADJ: 8
HIDDEN_APP_MIN_ADJ: 9
HIDDEN_APP_MAX_ADJ: 15

OOM ADJ levels 10,11,12,13,14 are also cached/hidden apps. Levels with "-" ADJ will never be killed.

So be sure to configure the OOM ADJ file correctly:

echo "0,1,2,4,9,15" > /sys/module/lowmemorykiller/parameters/adj

echo "6144,8192,10240,12288,14336,16384" > /sys/module/lowmemorykiller/parameters/minfree

0 FOREGROUND_APP 24MB
1 VISIBLE_APP 32MB
2 PERCEPTIBLE_APP 40MB
3
4 BACKUP_APP 48MB
5
6
7
8
9 HIDDEN_APP_MIN 56MB
10
11
12
13
14
15 HIDDEN_APP_MAX 64MB

All other levels take the value of the above defined level. So ADJ level 6 gets the MB value of ADJ 9.

(note: There can only be 6 OOM ADJ levels in the adj file?)

The ADJ file can contain OOM SCORE instead of the written OOM ADJ values: writing 0,1,2,4,9,15 will read 0,58,117,235,529,1000

OOM_SCORES go up with the OOM_ADJ level. So apps in the foreground (ADJ 0) will have OOM_SCORE like 50,

apps with ADJ 15 will have OOM_SCORE up to 1000.

Lets check when the launcher will be killed.

Situation A

With dumpsys activity oom we find

Proc #23: adj=fore /FA trm= 0 742:com.anddoes.launcher/u0a130 (top-activity)
oom: max=15 hidden=10 curRaw=0 setRaw=0 cur=0 set=0
keeping=true hidden=false empty=false hasAboveClient=false

PID of launcher is 742 with OOM_ADJ of 0 (not home adj but 0 since it is foreground app at this moment).

Now see what the real OOM SCORE value is with cat /proc/742/oom_score That gives a value of 69.

(or use ps -o command)

It is foreground app now with score 69. So if allocatable mem < 24MB it might get killed.

Situation B

When launcher is not the foreground app we see: ps 742 -o

USER PID PPID VSIZE RSS OOM_ADJ OOM_SCORE WCHAN PC NAME

u0_a130 742 151 413800 60108 6 422 ffffffff 4020da70 S com.anddoes.launcher

Now lancher has HOME_APP adj of 6 with an OOM_SCORE of 422. So if allocatable mem < 56MB it is a candidate to get killed.

Note: OOM_ADJ 6 is not listed in adj config file. But ADJ 9 is. So ADJ 6 will take its level from 9 which is 56MB.

What process is killed first?

For every process (with a specific OOM_ADJ level) the OOM_SCORE is calculated/adjusted. Processes with higher OOM_SCORE will be killed sooner when allocatable (not free) RAM drop below given level.

Check all processes with ps -o and watch the OOM_SORE column.

Note: if you configure OOM options to minimal you can experience high cpu usage due to kswapd0 deadlock on no swap file device

Cheers
[Xperia SP General] torhect:
Hey nice article very interesting but I want to know something I have a s7 edge I want to take advantage of the 4gb capabilities what would be the best combination of the 6 states of ram ??? :)
[8525, TyTN, MDA Vario II, JasJam General] dsdsds:
Here are my results with both the phones under HSDPA coverage in Milan (Italy):

www.speedtest.net results:

Location and date: Milano (Italy), 25/8/2006 3:13~3:53pm

Operator: TIM

Under coverage: HSDPA+UMTS+EDGE+GPRS

Connection type: fixed PC -> USB -> cell.

Cell.: HTC Tytn (ROM date: 7/22/06 - ExtROM version: 1.18.255.106)

8/25/2006 1:24 PM GMT 1120 kb/s 307 kb/s 305 ms San Francisco, CA ~ 6250 mi

8/25/2006 1:16 PM GMT 1061 kb/s 307 kb/s 275 ms New York, NY ~ 4300 mi

8/25/2006 1:14 PM GMT 1195 kb/s 336 kb/s 185 ms Karlsruhe (Germany) ~ 550 mi

8/25/2006 1:13 PM GMT 1174 kb/s 335 kb/s 146 ms London ~ 900 mi

8/25/2006 1:25 PM GMT 1120 kb/s 306 kb/s 195 ms Moscow ~ 1500 mi

8/25/2006 1:30 PM GMT 1008 kb/s 181 kb/s 826 ms Melbourne ~ 9950 mi

8/25/2006 1:27 PM GMT 232 kb/s 177 kb/s 454 ms Sydney ~ 9000 mi

Cell.: HTC Universal (Vodafone v1605)

8/25/2006 1:53 PM GMT 324 kb/s 54 kb/s 444 ms San Francisco, CA ~ 6250 mi

8/25/2006 1:52 PM GMT 360 kb/s 54 kb/s 405 ms New York, NY ~ 4300 mi

8/25/2006 1:48 PM GMT 365 kb/s 57 kb/s 300 ms Karlsruhe (Germany) ~ 550 mi

8/25/2006 1:50 PM GMT 356 kb/s 57 kb/s 264 ms London ~ 900 mi

8/25/2006 1:46 PM GMT 359 kb/s 52 kb/s 304 ms Moscow ~ 1500 mi

8/25/2006 1:41 PM GMT 366 kb/s 54 kb/s 901 ms Melbourne ~ 9950 mi

8/25/2006 1:40 PM GMT 197 kb/s 54 kb/s 584 ms Sydney ~ 10150 mi

As you see the Tytn/HSDPA actually performs about 3 times faster than the Universal/UMTS!

dsdsds
[Galaxy Ace S5830 Q&A, Help & Troubleshooting] Mouad Sy:
My galaxy ace GT-s5830 can't boot when only on battery.. and when i plug in an usd cable.. it can only get into downloading mode ..

I tried to install an official firmware with odin but after all the steps i get "PASS" , whatever the phone do not reboot it only shutdown.

Please i allready searched in the topics but i can't get any solution.

Sorry for the bad english !!

Thanks.
[Galaxy Ace S5830 Q&A, Help & Troubleshooting] Deleted member 5617821:
Go to recovery mode (hold Home+ Power button) and do a wipe data/ factory reset & wipe cache. Now choose Reboot now. See if it works. Do post the result. Hope I Helped :)
[Galaxy Ace S5830 Q&A, Help & Troubleshooting] Mouad Sy:
Thank you for replying but i can't get into recovery mode... As i said i can only get into downloading mode !
[Galaxy Ace S5830 Q&A, Help & Troubleshooting] Deleted member 5617821:
I think it must be a hardware problem. Better consult a Service Center. Hope I Helped :)
[Xperia Z1 Q&A, Help & Troubleshooting] Masih60:
Hi there,

I have a very serious problem! Today I found out that when someone calls me or I call somebody that person can't hear my voice! Except when I am shouting! What is my problem exactly? Is there any settings to fix it?
[Xperia Z1 Q&A, Help & Troubleshooting] gregbradley:
Have you got the phone the right way round to your ear?
[Xperia Z1 Q&A, Help & Troubleshooting] Masih60:
Yes, of course and my problem is that the other people can't hear my voice! Not myself!
[Xperia Z1 Q&A, Help & Troubleshooting] gregbradley:
.. sorry for the troll...

I meant if you had the phone the wrong way round the microphone would not be near your mouth..

Partly the reason for my troll was because I had no information from you to go on...

FW?

Rooted?

ROM?

Unlocked bootloader?

Kernal?

Any mods installed?

What was the last thing you did from when it worked to when it stopped working?
[Xperia Z1 Q&A, Help & Troubleshooting] Fiso:
Try repair from pc companion if it doesn't work flashing other roms like CM11 amd see if the problem persists

Make sure you have TA backed up just in case it does persist

If the problem persists ita probably hardware issue so go back to stock-restore TA to lock bootloader and call Sony don't mention anything about bootloader or CM11 don't even say root or rom.

yup owns Z1 and stuff. Also if I've helped you don't forget to hit THANKS - actions speak louder that words.
[Xperia Z1 Q&A, Help & Troubleshooting] Masih60:
Thanks a lot for help! But how can I repair my device with PC companion? There is not any settings that can repair device.
[Xperia Z1 Q&A, Help & Troubleshooting] Fiso:
http://talk.sonymobile.com/t5/Xperi...ctions-using-Pc-Companion-Windows/td-p/249946

yup owns Z1 and stuff. Also if I've helped you don't forget to hit THANKS - actions speak louder that words.
[Xperia Z1 Q&A, Help & Troubleshooting] darthxa:
Hey dudes,

i had the same problem with my MIC, sometimes was like i speak of under water others nobody listen nothing.

I had tried everything possible, Downgrade Firmware, unlock Backup TA partition and relock bootloader, Recover by SUS, Format,

and i was quite sad that i would send my phone to warranty...

then my wife realized that i never put my phone underwater, and went to take a look with that face "I'll find a hardware issue that you couldn't in the last 2 weeks" and she noted that my grid was so dirty that was almost brow, hehehe, then i cleaned up with a soft tooth brush and a vaccun cleaner amd....

VOILÀ, my MIC returned to life, even with noise supressor is on!!!

Take a look into yours grid, perhaps thats is the same problem
[Moto X Q&A] Kevin Durant:
Having trouble deciding between yellow and gold accents for royal moto was wondering if anyone had any pictures of either to compare or experiences to share
[Moto X Q&A] Mont:
Go gold

Sent from Moto X