Possible ram fix for 4.3, NEED TESTERS!

Search This thread

@non4

Senior Member
Jun 11, 2012
3,967
839
Gothicus
So a while ago I discussed with my friend rohit joshi (developer of tegra overclock) about a system file called adj, and how it may be responsible for sometimes disturbing ram behaviour. It couldn't be adjusted AFAIK on 4.1, but it seems to allow modification on 4.3.

1: Mount system R/W

2: Open /sys/module/lowmemorykiller/parameters/and open the file named adj

3: Change it to the following: 0,10,25,50,80,150 and save the file

Now please observe ram management in intense situations such as using chrome or heavy games, so far I have noticed no irrational behavior like asphalt 8 committing suicide etc, but its early days and we need more data. Custom values are welcome but please mention what you used

Note: These values reset upon reboot

Sent while my supervisor wasn't looking
 

@non4

Senior Member
Jun 11, 2012
3,967
839
Gothicus
Hmm this isn't really it's purpose, also these values fluctuate on their own btw ;). It's supposed to stop foreground processes and other important stuff from getting killed in low memory situations, for example once my alarm stopped responding because I was busy extracting a zip file. This fix is for this kind of wierdness

Sent while my supervisor wasn't looking
 

freedom74

Senior Member
Feb 22, 2011
200
57
Belgrade
3: Change it to the following: 0,10,25,50,80,150 and save the file

Could you explain more what these values are...
is it oom_adj parameters
and why changing them so drastically?
Default values are 0,58,117,235,529,1000

Shouldn't we try first minfree parameters which are also IMHO odd...
15000,17532,20065,22598,25131,30263 which equals (Nx4/1024)
58.6 68.5 78.4 88.3 98.2 118.2 Megabytes

I change mine to 8192,16384,18432,24576,32768,65536 or 32,64,72,96,128,256 Mb

so far so good... will see over a longer period of time... :silly:
 
Last edited:
  • Like
Reactions: @non4

@non4

Senior Member
Jun 11, 2012
3,967
839
Gothicus
Could you explain more what these values are...
is it oom_adj parameters
and why changing them so drastically?
Default values are 0,58,117,235,529,1000

Shouldn't we try first minfree parameters which are also IMHO odd...
15000,17532,20065,22598,25131,30263 which equals (Nx4/1024)
58.6 68.5 78.4 88.3 98.2 118.2 Megabytes

I change mine to 8192,16384,18432,24576,32768,65536 or 32,64,72,96,128,256 Mb

so far so good... will se over a longer period of time... :silly:

I changed them this way simply based on advice given, as I say different values are welcome :) I don't fully understand it myself however what I know is it seems to be working. I have been told that newer snapdragon devices have different adjacent values to other phones. This causes apps that SHOULD be closed to instead not be closed and so the system resorts to closing your fave game or whatever. Adjacent and minfrees have a relationship but I'm not sure exactly how it works, will try and find some better info on it

Sent while my supervisor wasn't looking
 

@non4

Senior Member
Jun 11, 2012
3,967
839
Gothicus
asphalt 8 close by itself if i play tokyo track.. on other track game works nicely

Hmm just spotted your comment there, I've been running Tokyo fine on high graphics, have you done anything else to the ram like change the minfrees? Feel free to play around with these values and report if you have any luck

Sent while my supervisor wasn't looking
 

poran123

Senior Member
Aug 12, 2012
1,139
122
30
Shillong
Hmm just spotted your comment there, I've been running Tokyo fine on high graphics, have you done anything else to the ram like change the minfrees? Feel free to play around with these values and report if you have any luck

Sent while my supervisor wasn't looking

i didnt change anything only did what is written on the op....
 
  • Like
Reactions: @non4

@non4

Senior Member
Jun 11, 2012
3,967
839
Gothicus
i didnt change anything only did what is written on the op....

Lol, I just got the dreaded home crash! Will continue to experiment, it makes no sense how bad it is, I just ran this game on high graphics on a galaxy s2 and homescreen didn't even redraw when I was done!

I found some info on this driver here:
https://android.googlesource.com/ke...4ac/drivers/staging/android/lowmemorykiller.c

It might actually be worth trying higher values instead of lower ones from what I'm reading here

Sent while my supervisor wasn't looking
 
Last edited:
  • Like
Reactions: rogermontane

freedom74

Senior Member
Feb 22, 2011
200
57
Belgrade
How is it going with adj settings?


According to http://xdaforums.com/showpost.php?p=5442369&nocache=1&z=6948587024309106
adj values determines how apps will be killed in case of Out Of Memory situations
Numbers are, similar to minfree settings connected to
ForegroundAPP, VisibleAPP, SecondaryServer, HiddenAPP, ContentProvider, EmptyAPP and hence the numbers
0,58,117,235,529,1000
The higher number, more probably the process will bi killed.
You can say "if free memory goes below XXXX then kill some process with oom_adj greater then YYY; if free memory goes even more below than ZZZ then start to kill some processes with oom_adj greater than XYXY. and so on.."
So, values 0,10,25,50,80,150 for adj
will give results but also kills too many processes, maybe some important ones.
Maybe someone that have expeirience with linux kernels can answer the question:
Who sets oom_adj parameter of a process?
IMHO, by setting these adj values, you tell system to treat all processes with oom_adj higher than 150 like EMPTY_APP
Will try changing adj settings but perhaps with some less agressive parameters... let's say half of the original :cool:

0,25,50,100,250,500
 
Last edited:

danielhariri

Senior Member
Aug 27, 2013
288
76
someone told that actually sony latest framework that eat ram.. not by apps/bloatware.. which mean even though we kill foreground app.. it will load more cpu after that.. will raise more probs such as lags n battery drain.. but simply for playing heavy games i think it works.. :D
sony knows this issue... maybe they will fix it in the next update.. maybe :(
 

@non4

Senior Member
Jun 11, 2012
3,967
839
Gothicus
I've been playing around and conclude that this works somewhat but you must lower your minfrees too for maximum effect, not sure what the best combination of values is just yet, seems lower = better, but too low may cause lag as ram fills up. One more thing is I noticed sometimes adj changes it's values back, perhaps if it considers them invalid as it only happens with certain values I tried

Sent while my supervisor wasn't looking
 

miladmohlek

New member
Aug 27, 2013
4
0
hi
i Change it to the following: 0,10,25,50,80,150 and save the file but When it was reset phone, Has not changed ... whay ?
 

freedom74

Senior Member
Feb 22, 2011
200
57
Belgrade
/sys is not a real directory
It's a virtual file system so everything you change vanishes after reboot.

If you have some settings other than defaults you want to put into /sys you can do it via init.d scripts during the boot time.


Sent from my C5303 using xda app-developers app
 
  • Like
Reactions: miladmohlek

miladmohlek

New member
Aug 27, 2013
4
0
/sys is not a real directory
It's a virtual file system so everything you change vanishes after reboot.

If you have some settings other than defaults you want to put into /sys you can do it via init.d scripts during the boot time.


Sent from my C5303 using xda app-developers app

Catch !! sorry
I just did that? 0,58,117,235,529,1000 After rebooting Can not be changed? not changed!!
 

freedom74

Senior Member
Feb 22, 2011
200
57
Belgrade
Well, I said if you want your values get inserted automatically you need init.d script.
But since these values we talk about here are still unconfirmed and for testing I think it's better to stick with manual entering rather than automatic.

What I do is that I typed as SU in command prompt using Android Terminal app a command
echo "0,10,25,50,80,150“ > /sys/module/lowmemorykiller/parameter/adj

Same for minfree settings


Sent from my C5303 using xda app-developers app
 
Last edited:
  • Like
Reactions: miladmohlek

@non4

Senior Member
Jun 11, 2012
3,967
839
Gothicus
Well, I said if you want your values get inserted automatically you need init.d script.
But since these values we talk about here are still unconfirmed and for testing I think it's better to stick with manual entering rather than automatic.

What I do is that I typed as SU in command prompt using Android Terminal app a command
echo "0,10,25,50,80,150“ > /sys/module/lowmemorykiller/parameter/adj

Same for minfree settings


Sent from my C5303 using xda app-developers app

And for init.d

#! /system/bin/sh

echo "0,10,25,50,80,150“ > /sys/module/lowmemorykiller/parameter/adj

Sent while my supervisor wasn't looking
 
  • Like
Reactions: miladmohlek

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    So a while ago I discussed with my friend rohit joshi (developer of tegra overclock) about a system file called adj, and how it may be responsible for sometimes disturbing ram behaviour. It couldn't be adjusted AFAIK on 4.1, but it seems to allow modification on 4.3.

    1: Mount system R/W

    2: Open /sys/module/lowmemorykiller/parameters/and open the file named adj

    3: Change it to the following: 0,10,25,50,80,150 and save the file

    Now please observe ram management in intense situations such as using chrome or heavy games, so far I have noticed no irrational behavior like asphalt 8 committing suicide etc, but its early days and we need more data. Custom values are welcome but please mention what you used

    Note: These values reset upon reboot

    Sent while my supervisor wasn't looking
    1
    3: Change it to the following: 0,10,25,50,80,150 and save the file

    Could you explain more what these values are...
    is it oom_adj parameters
    and why changing them so drastically?
    Default values are 0,58,117,235,529,1000

    Shouldn't we try first minfree parameters which are also IMHO odd...
    15000,17532,20065,22598,25131,30263 which equals (Nx4/1024)
    58.6 68.5 78.4 88.3 98.2 118.2 Megabytes

    I change mine to 8192,16384,18432,24576,32768,65536 or 32,64,72,96,128,256 Mb

    so far so good... will see over a longer period of time... :silly:
    1
    Hmm just spotted your comment there, I've been running Tokyo fine on high graphics, have you done anything else to the ram like change the minfrees? Feel free to play around with these values and report if you have any luck

    Sent while my supervisor wasn't looking

    i didnt change anything only did what is written on the op....
    1
    i didnt change anything only did what is written on the op....

    Lol, I just got the dreaded home crash! Will continue to experiment, it makes no sense how bad it is, I just ran this game on high graphics on a galaxy s2 and homescreen didn't even redraw when I was done!

    I found some info on this driver here:
    https://android.googlesource.com/ke...4ac/drivers/staging/android/lowmemorykiller.c

    It might actually be worth trying higher values instead of lower ones from what I'm reading here

    Sent while my supervisor wasn't looking
    1
    /sys is not a real directory
    It's a virtual file system so everything you change vanishes after reboot.

    If you have some settings other than defaults you want to put into /sys you can do it via init.d scripts during the boot time.


    Sent from my C5303 using xda app-developers app