[MOD] One stop for tweaks and other useful cool stuff - Motorola Droid Android Development

ok, from my android tweaking and playing around with all kinds of settings and other things i know it can be somewhat hard to find everything you might need to make the most of your android device so i will put links to them here along with providing support and my own little discoveries here...if anyone knows anything else that is cool or useful just post it and i'll update this post (btw these are tested on droid 1 only but many may apply to most android devices)
*Anyone who knows of any other tweaks/mods/scripts/useful terminal commands please feel free to post and i'll add it here (after testing it if possible)*
***disclaimer- I am not responsible for any damage you may do to your device, please make sure to have a backup before doing any of these tweaks***
first off how about a simple rooting/returning to stock guide?
quick root guide
1)download these files
http://www.motorola.com/staticfiles/Support/Experiences/Global_Drivers/MotoHelper_2.0.40_Driver_4.9.0.exe
http://wonderly.com/bb/DROID/OEM/rsdlite_5.0.msi
http://wonderly.com/bb/DROID/OEM/VZW_A855_QSC6085BP_RZRECOVERY_UPDATE.sbf
http://wonderly.com/bb/DROID/OEM/update.zip
2)install the first 2 links in order
3)connect your phone via usb to your computer and copy the update.zip you downloaded to your sdcard
4)reboot your phone and hold power + vloume up + the camera button until you see the screen that says bootloader battery ok
5)open rsd lite and see if it recognizes your phone (basically any entry in the model column) and slide your phone keyboard open
6) click the ... near the start button and navigate and select the VZW_A855_QSC6085BP_RZRECOVERY_UPDATE.sbf file
7)click start and WATCH FOR "Phone[0000]: Phone is being rebooted" On your phone the screen will change to "SW Update Complete" and your phone will reboot within a second or two. You want to be already holding the x button on your keyboard to boot into recovery mode when the phone actually reboots so the stock OS doesnt erase the new recovery you just flashed
8) using the volume keys to move through the menu, the camera button to select and the power button to go back, go to install and select the update.zip you put on your sdcard earlier and select install update.zip
9) then select "reboot into android" and enjoy the benefits of being rooted
return to stock
1)download these files
http://www.motorola.com/staticfiles...al_Drivers/MotoHelper_2.0.40_Driver_4.9.0.exe
http://wonderly.com/bb/DROID/OEM/rsdlite_5.0.msi
http://wonderly.com/bb/DROID/OEM/VZW_A855_FRG22D_QSC6085BP_C_01.43.01P_SW_UPDATE.sbf
2)install the first 2 files
3)reboot your phone and hold power + vloume up + the camera button until you see the screen that says bootloader battery ok
4)connect your phone via usb to your computer and reboot your phone and hold power + vloume up + the camera button until you see the screen that says bootloader battery ok
5)open rsd lite and see if it recognizes your phone (basically any entry in the model column)
here are are some useful build.prop tweaks I've encountered along the way, just put the line into the build.prop or modify it if its already in there, save, wipe dalvik cache and reboot
6) click the ... near the start button and navigate and select the VZW_A855_FRG22D_QSC6085BP_C_01.43.01P_SW_UPDATE.sb f you downloaded earlier
7)click start and let it run and reboot automatically (it should work even if rsd lite says the result was fail)
8) you are now on stock unrooted froyo
FRG22D
(optional) 9) go to settings > about phone> check for updates and allow system updates to download and install (allows for a super clean setup if you are planning to re-root)
for possibly better scrolling speed, can be set to any number from 35-300:
# This defines the max event window manager can
# handle in 1 s. We may adjust this # for performance
# reason later
windowsmgr.max_events_per_sec=
change lcd density (already in build.prop), which is like changing the resolution on a windows computer can be anywhere from 140 to 260 (under 200 not recommended because everything may be too small for the phone to be usable:
ro.sf.lcd_density=
dalvik cache virtual memory size (already in build.prop)...can also help performance. set anywhere from 24m to 64m based on how complex your setup is. i.e. tons of apps, in depth theme, memory intensive apps, etc.
dalvik.vm.heapsize=
incoming ringer delay (already in build.prop) sets how soon the phone starts ringing when a call comes in. set between 0 and 2000
ro.telephony.call_ring.delay=
proximity delay. sets how long before screen turns off during call. set between 0 and 600
# Proximit sensor screen off delay
mot.proximity.delay=
tcp stack- optimizes data performance
net.tcp.buffersize.default=4096,87380,256960,4096, 16384,256960
net.tcp.buffersize.wifi=4096,87380,256960,4096,163 84,256960
net.tcp.buffersize.umts=4096,87380,256960,4096,163 84,256960
net.tcp.buffersize.gprs=4096,87380,256960,4096,163 84,256960
net.tcp.buffersize.edge=4096,87380,256960,4096,163 84,256960
enable hardware acceleration
# Render UI through GPU instead of CPU
# Comment out if this causes laggy UI (it should speed up UI)
debug.sf.hw=1
sleep mode for battery savings. 0 means power collapse suspend, 1 is power collapse (usually the best choice), 2 is apps go to sleep, 3 is show clock and wait, 4 is wait for interrupt...not sure which each one does or is good for, just know about this little tweak lol
# Battery Savings (Sleep Mode)
pm.sleep_mode=
more battery savings
# When moving through zones or losing signal, having a delay
# smooths out constant disconnects and reconnects, which in turn
# saves a ton of battery life!
ro.mot.eri.losalert.delay=1000
disable sending usage data
ro.config.nocheckin=1
wifi scan interval (already in build.prop) can save battery as well. set from 15 to 999
# Time between scans in seconds. Keep it high to minimize battery drain.
# This only affects the case in which there are remembered access points,
# but none are in range.
wifi.supplicant_scan_interval=
ok, now for some useful links (all credit goes to the creators of these cool tweaks/apps/programs
v6 supercharger by zepplinrox - http://forum.xda-developers.com/showpost.php?p=18703418&postcount=5021
Deodex/odex tweak by Nibras, Reeza & Danzano (thanks to BrUhNiGGs for finding this) - http://www.droidforums.net/forum/steel-droid/200388-ram-tweak-free-up-more-ram-make-apps-load-faster.html
setcpu for free (legitimately legal lol) - http://forum.xda-developers.com/showthread.php?t=505419
wifi tethering app Downloads - http://code.google.com/p/android-wifi-tether/downloads/list
wired tethering app Downloads - http://code.google.com/p/android-wired-tether/downloads/list
easy install of adb http://www.droidforums.net/forum/chevyno1/162984-your-1-adb-source-7-29-11-a.html
Guide to building a rom from source (credit to chevycam and SnkBitten) - http://www.droidforums.net/forum/steel-droid/196475-guide-how-build-your-own-rom-cm7-source.html
Ok, here's a new section with just general tips, tricks and scripts
Useful terminal emulator scripts run as superuser (su)
*Using the debugging logging to report issues
Code:
logcat > /mnt/sdcard/logcat.txt
wait 4-5 seconds then hold volume up and press f on the keyboard to stop it
if logcat is disabled then do this instead
Code:
dmesg > /mnt/sdcard/dmesg.txt
wait 4-5 seconds then hold volume up and press f on the keyboard to stop it
*Find top CPU/memory using apps. value after -m is how many apps to show, value after -n is how many times to update (be sure to set this value or it will run endlessly until terminal is closed)
Code:
top -m 10 -n 1
*Find md5sum for downloaded files (checks to ensure proper downloads especially for roms, just compare your result to whatever value the rom developer provides and they should match)
Code:
md5sum /mnt/sdcard/(file path on sdcard)
For example
Code:
md5sum /mnt/sdcard/download/SD_9.0.0.zip
*Use swap partition without swapper2.
Add this script to the end of any file in the /etc/init.d folder. If you don't have one just run it in terminal emulator each reboot and run it in terminal first since sometimes its mmcblk0p2 instead of mmcblk0p3 depending on where you have the swap partition (or use the app script manager to make it run at boot. Script manager doesn't run continuously like swapper2)
Code:
swapon /dev/block/mmcblk0p3
And to turn swap off
Code:
swapoff /dev/block/mmcblk0p3
*Setting swappiness
Add or edit this line in the file etc/sysctl.config using whatever value you want, just keep the spaces (open in text editor)
vm.swappiness = 30
Or add this to the end of a script in init.d or run in terminal emulator
Code:
sysctl -w vm.swappiness=30
*Loading a module for apps2sdext (link2sd style apps2sd)
Run this in terminal emulator with superuser permission, substituting ext3 for whatever extension you want loaded (keep the .ko though)
Code:
insmod /system/lib/modules/ext3.ko
or the simple way
Code:
modprobe ext3
*Listing loaded modules
Run this in terminal emulator with superuser permissions
Code:
lsmod
*Forcing a hot reboot to clear caches
Run this in terminal emulator with superuser permissions
Code:
pkill zygote
*terminal tips-
Find list of many possible scripts to run
Code:
busybox
List sysctl commands
Code:
sysct -h
List first or last 10 lines of another scripts output (note | is not lower case L, its a separate character)
First 10-
Code:
(script) | head
Last 10
Code:
(script) | tail
Example (list first 10 sysctl values)
Code:
sysctl -a | head
Finding lines with certain letters/word in another scripts output
Code:
(script) | grep (letters/word)
Example (show only sysctl lines with vm in them) (note | is not lower case L, its a separate character)
Code:
sysctl -a | grep vm
Don't worry more to come soon
Ok, those are the well tested tweaks, now for a few experimental ones. Please make sure to have a backup ready to restore since these ARE experimental and may cause your rom not to load
improve peformance?
Add this to the build.prop
#disable the zygote loader
ro.wmt.blcr.enable=0
Fix app issues? (change it to 0 to improve performance)
Add this to build.prop
ro.kernel.android.checkjni=1
Change the I/O scheduler (effects how your phone reads and writes data)(first line tells you whats available and what you currently have in [ ], then put whichever one you want in the "" after echo, and the last line will confirm the change)
Code:
cat /sys/block/*/queue/scheduler
for i in /sys/block/*/queue/scheduler
do
echo "deadline" > $i
done
cat /sys/block/*/queue/scheduler
Increse overall touch resposivness?
Add these to build.prop
debug.performance.tuning=1
video.accelerate.hw=1
ro.min_pointer_dur=8
Raise Photo and video quality?
Add these to build.prop
ro.media.enc.jpeg.quality=100
ro.media.dec.jpeg.memcap=8000000
ro.media.enc.hprof.vid.bps=8000000
change sdcard buffer speed
run in terminal emulator as superuser (su) or put #!/system/bin/sh as first line and put in /system/etc/init.d (you can change the value in the "echo 512 > /sys/devices/virtual/bdi/179:0/read_ahead_kb" line to suit your needs- common values are 256, 512, 1024, 2048, 3072, 4096, 5120, 6144)
Code:
for i in /sys/devices/virtual/bdi/*
do
echo 2 > $i/read_ahead_kb
done
echo 2048 > /sys/devices/virtual/bdi/179:0/read_ahead_kb
echo 2 > /sys/devices/virtual/bdi/default/read_ahead_kb
or you can try just simply using the simple version
Code:
echo 2048 > /sys/devices/virtual/bdi/179:0/read_ahead_kb
Disable boot animation
add to build.prop (use caution after wiping dalvik, it will appear to hang at the M but its usually still booting up all the way)
dev.sfbootcomplete=0
Use dalvik JIT compiler
add to build.prop (Just In Time compiler is much faster)
dalvik.vm.execution-mode=int:jit
Improve performance?
change in build.prop
ro.setupwizard.mode=DISABLED
Rom dependent tweaks (will only work if these features are included in your rom and most are included in settings anyway, most of the time they are but if not sure then ask the dev) add these to build.prop, 1 is on 0 is off
help to free up unused ram-
persist.sys.purgeable_assets=
stop usb debugging on notification-
persist.adb.notify=
Force capacitive buttons to stay on while screen is on?-
ro.mot.buttonlight.timeout=
Improve screen quality at the cost of performance-
persist.sys.use.dithering=

*reserved*

**reserved**

and one more just in case
***reserved***

btw, i hope i posted this right, I'm still new here to xda forums, i hope i posted in the right section too...if not then someone can go ahead move it (if possible)

Nice collection!
Say, do you have anything specific to CDMA bandwidth?
I know my 3G TurboCharger has a positive effect somehow even though most of the entries are GSM related but hey... every bit helps

zeppelinrox said:
Nice collection!
Say, do you have anything specific to CDMA bandwidth?
I know my 3G TurboCharger has a positive effect somehow even though most of the entries are GSM related but hey... every bit helps
Click to expand...
Click to collapse
not sure if any of these would apply to data at all but i know kfazz posted them as the only ril settings for the droid, maybe this could further improve speed on all devices if anything applies to mobile data
Moto ril sholes accepted properties found via strings
persist.ril.mux.timeout.enbld
persist.ril.enableradio.powerup
persist.ril.uart.flowctrl
persist.ril.mux.noofchannels
persist.ril.mux.ttydevice
persist.ril.mux.retries
persist.ril.mux.sleep
persist.ril.mux.logmask
persist.ril.rssi.enable.param6
persist.ril.modem.ttydevice
persist.ril.pppd.start.fail.max
ro.ril.ecclist
ro.ril.barcode
ro.build.id
/data/data/com.motorola.motoapr.service/paniclogging
/data/misc/ril/ril_apr.log
Click to expand...
Click to collapse

Ok I guess those are boolean values soget either = 0 or =1 values then?
Well that's weird.. I didn't know there are ro.cdma values...
http://pastebin.com/LWWcSMTD

zeppelinrox said:
Ok I guess those are boolean values soget either = 0 or =1 values then?
Well that's weird.. I didn't know there are ro.cdma values...
http://pastebin.com/LWWcSMTD
Click to expand...
Click to collapse
i searched for ro.cdma and found some others too
ril.cdma.ppp.up=3
ro.radio.use-ppp=yes
net.cdma.ppp-exit=0

cool... maybe you can test them see if you notice a difference?

zeppelinrox said:
cool... maybe you can test them see if you notice a difference?
Click to expand...
Click to collapse
I'll try it out but it I'll try it on something where the radio fully works lol, is still being fixed on the ics build but obviously I have to go back to gingerbread to make and receive calls, if it does anything on GB, then I'll test on ics, who knows it might fix the radio issues somehow

A friend of mine just asked me to root his old droid for him to use merely as a multimedia (music & video) and google docs device. Strictly Wifi, no service plan.
i plan on rooting, wiping, and running SteelDroid on it for him:
http://forum.xda-developers.com/showthread.php?t=1098483
I came across these tweaks and they look AWESOME. I just have a few questions about some of them in particular.
metalspring said:
for possibly better scrolling speed, can be set to any number from 35-300:
# This defines the max event window manager can
# handle in 1 s. We may adjust this # for performance
# reason later
windowsmgr.max_events_per_sec=
Click to expand...
Click to collapse
Is this in the build.prop or elsewhere?
metalspring said:
tcp stack- optimizes data performance
net.tcp.buffersize.default=4096,87380,256960,4096, 16384,256960
net.tcp.buffersize.wifi=4096,87380,256960,4096,163 84,256960
net.tcp.buffersize.umts=4096,87380,256960,4096,163 84,256960
net.tcp.buffersize.gprs=4096,87380,256960,4096,163 84,256960
net.tcp.buffersize.edge=4096,87380,256960,4096,163 84,256960
Click to expand...
Click to collapse
where do i find and change these? build.prop or elsewhere?
metalspring said:
enable hardware acceleration
# Render UI through GPU instead of CPU
# Comment out if this causes laggy UI (it should speed up UI)
debug.sf.hw=1
disable sending usage data
ro.config.nocheckin=1
Click to expand...
Click to collapse
in build.prop?
metalspring said:
Useful terminal emulator scripts run as superuser (su)
*Use swap partition without swapper2.
Add this script to the end of any file in the /etc/init.d folder. If you don't have one just run it in terminal emulator each reboot (or use the app script manager to make it run at boot. Script manager doesn't run continuously like swapper2)
swapon /dev/block/mmcblk0p3
And to turn swap off
swapoff /dev/block/mmcblk0p3
*Setting swappiness
Add or edit this line in the file etc/sysctl.config using whatever value you want, just keep the spaces (open in text editor)
vm.swappiness = 30
Or add this to the end of a script in init.d or run in terminal emulator
sysctl -w vm.swappiness=30
*Loading a module for apps2sdext (link2sd style apps2sd)
Run this in terminal emulator with superuser permission, substituting ext3 for whatever extension you want loaded (keep the .ko though)
insmod /system/lib/modules/ext3.ko
Click to expand...
Click to collapse
Can i make 2 scripts in script manager that can do this? or are there any available? I know on such a low ram & low internal storage device, swap and apps2sdext would be INCREDIBLY useful.. any tips on making this permanent? If i can make a script in SM i know i can set it start at boot. But i wouldn't need to do that for a2sdext right? once that's set, it's set and needs no changes right?
Also, would you suggest a custom rom like steeldroid or would i be better off stripping out the crapware from the stock ota rom (froyo) and just flashing a better compatible kernel and using some tweaks & scripts to speed things up a bit and optimize them for his purposes.
Let me know what you think?
thanks!

Originally Posted by metalspring
for possibly better scrolling speed, can be set to any number from 35-300:
# This defines the max event window manager can
# handle in 1 s. We may adjust this # for performance
# reason later
windowsmgr.max_events_per_sec=
Click to expand...
Click to collapse
Is this in the build.prop or elsewhere?
Originally Posted by metalspring
tcp stack- optimizes data performance
net.tcp.buffersize.default=4096,87380,256960,4096, 16384,256960
net.tcp.buffersize.wifi=4096,87380,256960,4096,163 84,256960
net.tcp.buffersize.umts=4096,87380,256960,4096,163 84,256960
net.tcp.buffersize.gprs=4096,87380,256960,4096,163 84,256960
net.tcp.buffersize.edge=4096,87380,256960,4096,163 84,256960
Click to expand...
Click to collapse
where do i find and change these? build.prop or elsewhere?
Originally Posted by metalspring
enable hardware acceleration
# Render UI through GPU instead of CPU
# Comment out if this causes laggy UI (it should speed up UI)
debug.sf.hw=1
disable sending usage data
ro.config.nocheckin=1
Click to expand...
Click to collapse
in build.prop?
Originally Posted by metalspring
Useful terminal emulator scripts run as superuser (su)
*Use swap partition without swapper2.
Add this script to the end of any file in the /etc/init.d folder. If you don't have one just run it in terminal emulator each reboot (or use the app script manager to make it run at boot. Script manager doesn't run continuously like swapper2)
swapon /dev/block/mmcblk0p3
And to turn swap off
swapoff /dev/block/mmcblk0p3
*Setting swappiness
Add or edit this line in the file etc/sysctl.config using whatever value you want, just keep the spaces (open in text editor)
vm.swappiness = 30
Or add this to the end of a script in init.d or run in terminal emulator
sysctl -w vm.swappiness=30
*Loading a module for apps2sdext (link2sd style apps2sd)
Run this in terminal emulator with superuser permission, substituting ext3 for whatever extension you want loaded (keep the .ko though)
insmod /system/lib/modules/ext3.ko
Click to expand...
Click to collapse
Can i make 2 scripts in script manager that can do this? or are there any available? I know on such a low ram & low internal storage device, swap and apps2sdext would be INCREDIBLY useful.. any tips on making this permanent? If i can make a script in SM i know i can set it start at boot. But i wouldn't need to do that for a2sdext right? once that's set, it's set and needs no changes right?
Also, would you suggest a custom rom like steeldroid or would i be better off stripping out the crapware from the stock ota rom (froyo) and just flashing a better compatible kernel and using some tweaks & scripts to speed things up a bit and optimize them for his purposes.
Let me know what you think?
thanks!
Click to expand...
Click to collapse
to the first 4 yes, just add them to the build.prop and for the last ones you can either use script manager to make a new script in the folder /system/etc/init.d
if you dont have an init.d folder then you have to have script manager to run them at boot (i'd suggest having the scripts in /data) and for apps2sdext, i'd suggest using the app link2sd, its basically the only way to control moving apps to the sdcard ext
also the biggest help for low ram devices is v6 supercharger and all the other zeppelinrox scripts
http://forum.xda-developers.com/showpost.php?p=18703418&postcount=5021
and i'd highly highly suggest steeldroid 10, its what i currently run and most of the tweaks i have in this thread are already included in it
and btw if you didnt know, in order to use swap and link2sd you have to format your sdcard and repartition it, the easiest way is installing rom manager, flashing clockwork recovery and there should be an option to partition your sdcard in rom manager (it will erase everything on your sdcard so back everything up)
also i'm going to update this thread with more stuff i've found

updated and cleaned up op

awesome! thanks! yea i know about partitioning the sdcard. I use both swap and a2ext on my htc g2, but they are part of the kernel on the ROM i run, i've never used any other software to initiate them.
Thanks for the tips!
Also, how can ANYONE flash roms from XDA and NOT know about the AMAZING supercharger v6 script!

first of all I want to thank the OP! being how this is not my phone but my brothers. he wants me to root it and install a rom. this thread made everything a whole lot simple.
now to bug you guys.. where can I find a suitable system recovery apk for this phone? I have one installed but it never boots into recovery. also I haz steel droid 10 running.
Sent from my DROID X2 using XDA App

motrinHD said:
first of all I want to thank the OP! being how this is not my phone but my brothers. he wants me to root it and install a rom. this thread made everything a whole lot simple.
now to bug you guys.. where can I find a suitable system recovery apk for this phone? I have one installed but it never boots into recovery. also I haz steel droid 10 running.
Sent from my DROID X2 using XDA App
Click to expand...
Click to collapse
if you're talking about a droid 1 then the instructions to root should install a custom recovery
If you're talking about a droid x2 as your signature suggests then I'd say try looking on droidforums.net... They are more dedicated to the droid series of android phones and I know any Motorola phone other than the droid 1 is more complicated because of a locked bootloader
You can try downloading rom manager to flash a recovery for either phone I believe
Also if you are already rooted and think you have a working recovery then try installing android terminal emulator from the market and typing in
su
reboot recovery

metalspring said:
if you're talking about a droid 1 then the instructions to root should install a custom recovery
If you're talking about a droid x2 as your signature suggests then I'd say try looking on droidforums.net... They are more dedicated to the droid series of android phones and I know any Motorola phone other than the droid 1 is more complicated because of a locked bootloader
You can try downloading rom manager to flash a recovery for either phone I believe
Also if you are already rooted and think you have a working recovery then try installing android terminal emulator from the market and typing in
su
reboot recovery
Click to expand...
Click to collapse
I am talking about the droid 1. tho I spf'd to 2.2 I then went with the one click root method. and it placed a system recovery apk on my sd but I find that it does not work. I'm going to try that emulator thing you suggested
Sent from my DROID X2 using XDA App

metalspring said:
to the first 4 yes, just add them to the build.prop and for the last ones you can either use script manager to make a new script in the folder /system/etc/init.d
if you dont have an init.d folder then you have to have script manager to run them at boot (i'd suggest having the scripts in /data) and for apps2sdext, i'd suggest using the app link2sd, its basically the only way to control moving apps to the sdcard ext
also the biggest help for low ram devices is v6 supercharger and all the other zeppelinrox scripts
http://forum.xda-developers.com/showpost.php?p=18703418&postcount=5021
and i'd highly highly suggest steeldroid 10, its what i currently run and most of the tweaks i have in this thread are already included in it
and btw if you didnt know, in order to use swap and link2sd you have to format your sdcard and repartition it, the easiest way is installing rom manager, flashing clockwork recovery and there should be an option to partition your sdcard in rom manager (it will erase everything on your sdcard so back everything up)
also i'm going to update this thread with more stuff i've found
Click to expand...
Click to collapse
MS,
I have learned alot from your posts. Thanks for the time spent sharing them. A few questions.
You mention and I have noticed many of the tweaks are already incorporated into Steel Droid X. (I am currently running the rc1 version with the last Deprimed Kernel.) Am am liking it ALOT!!.
Is there anyway you could somehow put a denotion on the tweaks that are already included in SDX? I think it would be helpful, as I certainly would find it so.
How much of a effect did you find running v6 supercharger had given the other changes already in SDX? Any conflicts or issues running it with this ROM?
I am planning on partitioning my SD card as I would like to try the benefits of a swap partition. Upon checking my usage I am considering a 128mb. Seems like a safe size all around. Believe you have posted this somewhere as well? Card is a 32g class 4. I have never messed with running a swap. Currently, I have a standard single FAT32 format part. I have a number of programs already set as loaded on the SD card so I will have to move those back.
I believe SDX has apps2sdext already, correct?
From your post I take I still need links2sd to have the apps to go to that swap partition?
Is there a good link to info on the hows, workings, etc on the swap partition, apps works? I can search for one, only if you happen to have a link handy.
Thanks for all your help.
BE

Related

Tweak Android for Performance, and increase battery by Saving Power Usage with Sysctl

Here I will post tweaks as I find them to optimize Android.
When echoing in the following sysctl settings they do not remain after reboot, so we can adb remount then create a sysctl.conf file on our pc's with these settings, then ./adb push sysctl.conf /etc/ then the kernel should apply the settings every reboot
For examples of a sysctl.conf use google: Sysctl.conf Examples
Open a Terminal and Execute these commands as root
Tweak virtual memory to conserve power when running on battery:
Code:
echo 0 > /proc/sys/vm/swappiness #can be ignored if you dont use swap
echo 0 > /proc/sys/vm/dirty_expire_centisecs #can be ignored if you dont use swap
echo 0 > /proc/sys/vm/dirty_writeback_centisecs #can be ignored if you dont use swap
echo 60 > /proc/sys/vm/dirty_background_ratio
echo 95 > /proc/sys/vm/dirty_ratio
Tweak virtual memory for running on Charger
Code:
echo 0 > /proc/sys/vm/swappiness #can be ignored if you dont use swap
echo 3000 > /proc/sys/vm/dirty_expire_centisecs #can be ignored if you dont use swap
echo 500 > /proc/sys/vm/dirty_writeback_centisecs #can be ignored if you dont use swap
echo 10 > /proc/sys/vm/dirty_background_ratio
echo 40 > /proc/sys/vm/dirty_ratio
Detecting apps/services that hog the battery/cpu:
Also while on battery, you should stop all applications that don't really stay idle when you're not using them, if you want to find which apps arent really staying idle you can:
Code:
strace -p $(pidof yourapp) # for all your running applications
ps aux | awk '{print$10,$11}' | sort -n # will list all running softs sorted by used cpu time
By default when Linux runs out of memory it goes through the process list and starts killing off processes that it thinks are using too much memory. This sysctl makes Linux kill the runaway process that made the system run out of memory instead, which is usually what you want.(this will also reduce cpu time and increase battery usage).
Code:
sysctl -w vm.oom_kill_allocating_task=1
Credit: ccpp0
vfs_cache_pressure to 10 , gives more mem to cache fs dentry and inode to save cpu
At the default value of vfs_cache_pressure = 100 the kernel will attempt to reclaim dentries and inodes at a "fair" rate with respect to pagecache and swapcache reclaim. Decreasing vfs_cache_pressure causes the kernel to prefer to retain dentry and inode caches. Increasing vfs_cache_pressure beyond 100 causes the kernel to prefer to reclaim dentries and inodes.
Code:
sysctl -w vm.vfs_cache_pressure=10
I'll be adding more tweaks for sysctl and basic cmd line tweaks as I find them, also these tweaks would be good integrated into roms, apps, and a power-save widget if anyone wants to get creative.
a few questions
do i enter this into the terminal emulator? also does this only need to be entered in one time? thank you in advance for any help.
great find.. will keep my eye on this thread
david1171 said:
do i enter this into the terminal emulator? also does this only need to be entered in one time? thank you in advance for any help.
Click to expand...
Click to collapse
yes you can enter it in via terminal emulator or ./adb shell, the echo'd settings are not permanent and will reset after reboot, so use the settings to test, then follow the directions to create a /etc/sysctl.conf file to make the settings permanent after you feel comfortable with the settings(if you notice improvement)
defcon
Wow, this is cool, thank you!
Could you maybe add some more comments, I don't really understand what the single commands do. Or some place, where the function of e.g. "dirty_expire_centisecs" is explained?
One more precise question though: If I don't have a swap file on sd, does the tweaking of the swappiness still change anything?
Greetings!
free-sidux said:
Wow, this is cool, thank you!
Could you maybe add some more comments, I don't really understand what the single commands do. Or some place, where the function of e.g. "dirty_expire_centisecs" is explained?
One more precise question though: If I don't have a swap file on sd, does the tweaking of the swappiness still change anything?
Greetings!
Click to expand...
Click to collapse
there is no swap space on G1, so settings related to the swap can be ignored.
echo 0 > /proc/sys/vm/dirty_expire_centisecs
echo 0 > /proc/sys/vm/dirty_writeback_centisecs
never writes out dirty pages ?
free-sidux said:
Wow, this is cool, thank you!
Could you maybe add some more comments, I don't really understand what the single commands do. Or some place, where the function of e.g. "dirty_expire_centisecs" is explained?
One more precise question though: If I don't have a swap file on sd, does the tweaking of the swappiness still change anything?
Greetings!
Click to expand...
Click to collapse
http://tinyurl.com/nlb9ws
Note: The value of vm.swappiness=0 states that no swap space will be used at all, basically it can be ignored if you dont use swap though
defconoi said:
http://tinyurl.com/nlb9ws
Note: The value of vm.swappiness=0 states that no swap space will be used at all, basically it can be ignored if you dont use swap though
Click to expand...
Click to collapse
set vfs_cache_pressure to 10 , gives more mem to cache fs dentry and inode to save cpu "wa".
how do i create a Sysctl.conf file with this script?
i tried the link of examples but all i could find was info about it.
everything else works but when i try
sysctl vm.block_dump=1
i get sysctl: error: 'vm.block_dump=1' is an unknown key
any ideas?
actually ya know what I think we can just disable sysctl all together in menuconfig->Filesystems->Pseudo Filesystems->Proc->Sysctl Support when compiling a new kernel and setting these tweaks right in the kernel.
Says in menuconfig"As it is generally a good thing, you should say Y here unless
building a kernel for install/rescue disks or your system is very
limited in memory."
So I think we can gain some memory disabling this since we dont really need it
disable /dev/mem
Also I think we can disable the Memory Device Driver, /dev/mem, it says it can be disabled for security conscious and can be disabled on memory tight systems, which we are definitely memory tight plus there's just no valid app that uses /dev/mem on actual memory.
Other popular users of /dev/mem are rootkits and the like.
(note: mmap access of memory via /dev/mem was already not allowed since
a really long time)
People who want to use /dev/mem for kernel debugging can enable the config
option.
tshizzle said:
how do i create a Sysctl.conf file with this script?
i tried the link of examples but all i could find was info about it.
everything else works but when i try
sysctl vm.block_dump=1
i get sysctl: error: 'vm.block_dump=1' is an unknown key
any ideas?
Click to expand...
Click to collapse
I have the same exact questions that u do
Unix98_ptys
Also do we really need UNIX98_PTYS enabled?
We can also use this to conserve memory if we dont need this as well...
menuconfig says:
"Unix98 PTY support UNIX98_PTYS
A pseudo terminal (PTY) is a software device consisting of two
halves: a master and a slave. The slave device behaves identical to
a physical terminal; the master device is used by a process to
read data from and write data to the slave, thereby emulating a
terminal. Typical programs for the master side are telnet servers
and xterms.
Linux has traditionally used the BSD-like names /dev/ptyxx for
masters and /dev/ttyxx for slaves of pseudo terminals. This scheme
has a number of problems. The GNU C library glibc 2.1 and later,
however, supports the Unix98 naming standard: in order to acquire a
pseudo terminal, a process opens /dev/ptmx; the number of the pseudo
terminal is then made available to the process and the pseudo
terminal slave can be accessed as /dev/pts/<number>. What was
traditionally /dev/ttyp2 will then be /dev/pts/2, for example.
All modern Linux systems use the Unix98 ptys. Say Y unless
you're on an embedded system and want to conserve memory."
jroid said:
I have the same exact questions that u do
Click to expand...
Click to collapse
ahhhh it looks vm.block_dump=1 isnt a valid sysctl option, disregard that, gonna remove it from the first post
defconoi said:
ahhhh it looks vm.block_dump=1 isnt a valid sysctl option, disregard that, gonna remove it from the first post
Click to expand...
Click to collapse
yea. all the other ones work though. how would we make the file??
jroid said:
yea. all the other ones work though. how would we make the file??
Click to expand...
Click to collapse
adb remount
create sysctl.conf on your system
then adb push sysctk.conf /etc and the settings will be set every reboot.
defconoi said:
adb remount
create sysctl.conf on your system
then adb push sysctk.conf /etc and the settings will be set every reboot.
Click to expand...
Click to collapse
ok so it would be something like this?
adb remount
adb shell
mkdir /system/sysctl.conf
adb push sysctl.conf /system/etc
jroid said:
ok so it would be something like this?
adb remount
adb shell
mkdir /system/sysctl.conf
adb push sysctl.conf /system/etc
Click to expand...
Click to collapse
no, adb push sysctl.conf /etc
this isn't working. i created the dir sysctl.conf in /system then tried adb pushing it but says no such file or dir. then i tried in adb shell cp /system/sysctl.conf /etc
it says cp: omitting sysctl.conf is a directory"
couldnt i just create it directly in /etc?
like this mkdir /system/etc/sysctl.conf
defconoi said:
no, adb push sysctl.conf /etc
Click to expand...
Click to collapse
on android /etc is within the /system/etc directory.

[DEV] Script for tweaks (version 1.02) 18-12-2010

Here is a script i've made (had nothing to do, so...).
Phone must be rooted and have busybox installed.
What first menu looks like:
1 - enable/disable hardware acceleration
2 - enable/disable jit
3 - enable/disable stagefright player
4 - change heapsize
s - show status
r - revert to original configuration
q - quit (don't forget to reboot your phone!)
==================
enter your option:
Click to expand...
Click to collapse
Download:
http://www.4shared.com/file/gApTB6EG/tweaks.html
md5 b0865d9de67a82215913512cb644211d
Just copy the file to your sdcard. Then in a terminal emulator run:
su
cat /sdcard/tweaks > /data/tweaks
rm /sdcard/tweaks
cd /data/
./tweaks
If it doesn't run, type first:
chmod 755 /data/tweaks
Additional notes:
Script does not work if run from sdcard, must be in /data/ or /system/ (this one goes to allsalvati for testing)
---
If anything is wrong i will fix it, but only if you give me feedback
If you know any good tweaks, say it and i'll add them.
---
Changelog:
version 1.02:
backup/restore added
version 1.01d:
working again. sorry for the mess...
version 1.01c:
nothing new. just rearranging code
version 1.01b:
messages were not staying in output. fixed
version 1.01a:
small fix. v1.01 was not working
version 1.01:
added status menu
ruigui said:
Here is a script i've made (had nothing to do, so...). Phone must have busybox.
Download:
http://www.4shared.com/file/gApTB6EG/tweaks.html
md5 ea568c399c67ecd87db0dd790cdf0e93
Just copy the file to your sdcard. Then in a terminal emulator run:
cd /sdcard/
./tweaks
If it doesn't run, type first:
chmod 777 /sdcard/tweaks
Please give me some feedback. I don't own the phone so i can't test.
Click to expand...
Click to collapse
what the script does?
So script should be able to do:
enable/disable hw acceleration
enable/disable jit
enable/disable stagefright player
change heapsize
Yes. For now it's what it does.
The ideia is to be able to enable/disable a certain tweak, without reflashing zips, and rewriting files in phone.
But i need some feedback to know if it is working. I can't test it.
It will only change values in /data/local.prop, nothing else.
It seems that it is well written, so I will try that and let you know what's happened.
Thanks for testing. I'm still waiting to have some money so i can buy this phone...
Meanwhile, i'm "playing" with ROMs and files. I'm not good at scripting, but i'm trying to learn while doing something useful.
How much did you increase the heap size?
domenic_s said:
How much did you increase the heap size?
Click to expand...
Click to collapse
I didn't increase it. Script shows this message:
"default=24, recommended=32"
"enter new heapsize value (1-64): "
You can enter any value between 1 and 64.
If you enter any other value, or a string, character, symbol... script will show this message:
"wrong value"
"please input a value between 1 and 64"
For those who don't feel like editing this themselves this is great. Thanks for releasing it for people to try out more tweaks on stock ROMs.
i'm trying to run this script and gives me the following message: ./tweaks: permission denied
Before anything i typed su, then chmod 777 and it gave me error.
It should work be working...
Anyone else confirms this issue? Is this script running or not?
If it is working and there are more tweaks, i can easilly add them to the script.
If this is an isolated case, i really can't help. I don't own an android phone (yet), so i can't test....
allsalvati do you have busybox installed?
No, i don't.
Sent from my LG-P500h using XDA App
That may be your issue.
You must mount /system/ as read-write, then copy busybox binary to /system/xbin/, then run these commands in terminal emulator:
su
cd /system/xbin
/system/bin/chmod 755 busybox
./busybox --install -s /system/xbin
After that you can mount /system/ as read only again, and reboot your phone.
I don't know if there is another way to install it that is easier.
I downladed busybox installer from market and the app says that was installed. The. /tweaks gives me the same message.
How do i test if busybox was installed right?
Sent from my LG-P500h using XDA App
I found this:
That is a problem, you cannot chmod a script to executable on the SD card. (well some things can, but 99% no) the system is designed to prevent u executing scripts from an SD card
cp it to /system/xbin or /system/bin.
Or if u hate to see it in system', use /data/
THEN chmod it. should be fine to run
Click to expand...
Click to collapse
Try to copy the file to /data/ (so you don't mess with /system/), and then try to run it with:
cd /data/
chmod 777 tweaks
./tweaks
It should not need to be run as root
Moved to /data and worked.
I changed heap size to 32 and disabled hardware accelaration just to test.
With hw acc - 981 on Quadrant
Without - 820
So i think this is working.
Perhaps you should print the values so the user can see what is enabled or not before apply.
Thanks for your help
Sent from my LG-P500h using XDA App
Can you test something for me?
Make sure you have hardware acceleration disabled, and reboot you phone.
Then open terminal and run:
getprop | grep hw (see what it outputs)
then run the script, enable hardware acceleration on it, but DON'T reboot your phone yet.
Then exit script, and run again:
getprop | grep hw
Has the value changed, or is it the same?
I need to know if the system assumes immediately any changes (although they may not be functional until reboot).
This is needed to work on your request.
allsalvati said:
Perhaps you should print the values so the user can see what is enabled or not before apply.
Click to expand...
Click to collapse
I'll work on that and post an update after someone tries what i asked above.
Thanks for testing
EDIT: to test benchmarks, enable/disable jit. It gives greater differences in values
I tried what you say and both outputs are the same:
$getprop | grep hw
[debug.sf.hw]: [0]
[hw.keyboards.65537.devname]: [7k_handset]
[hw.keyboards.65540.devname]: [thunder_keypad]
[hw.keyboards.65541.devname]: [touch_mcs6000]
[hw.keyboards.65542.devname]: [atcmd_virtual_kbd]
Edit: Tested disabling JIT and it worked. Linpack Before 7.35 - After 4.3
So i can't rely on getprop to check current values...
If anything is changed, getprop won't give the right output till reboot.
Damn... Script was almost updated. Now i must find a new way and redo this section.
Thanks for testing again
EDIT:
New version for download at first post. status menu added.
I think it's all ok.
It seems work fine on my phone. But I can't see the status. When I choose to see current status or status after reboot, the screen of my emulator returns too fast to the selection menu (show curent status or after reboot) and I can't see anything !

[MOD](UPDATED) For those with battery issues

please dont forget to thank
loSconosciuto
ilcorsaronero
PureMotive
credits to loSconosciuto for modifying this mod to our galaxy sl and most especially to ilcorsaronero for the modification and for making the universal cwm flashable zip for our device
ilcorsaronero said:
Since noone was updating it, I provide a working flashable zip basing on this mod. There were more than one problem in the zip, but now I fixed them. Please report:
* if you notice a battery performance improvement
* how much is this improvement
* which MOD are you on
* which KERNEL are you on. This mod works only on init.d featured mod/kernels.
thanks.
Flash this through CWM recovery!
Click to expand...
Click to collapse
link to cwm flashable zip file
http://forum.xda-developers.com/showpost.php?p=25536103&postcount=27
original thread of this mod
credits to PureMotive
PureMotive said:
Okay guys, I just thought I'd give you my mod for achieving good-great battery life. This is the mod I use in Anthem™ which has given me 50+ hours on a single charge. Feel free to include it in your own ROM or whatever. Giving credit would be nice
First: Here is a flashable .zip of the mod that may or may not work with your ROM. I'd still advise doing it manually.
Sysctl.conf​
Step 1
Open up your ROM.zip (or whatever it's called) in 7zip (Windows) or Betterzip (OSX) and locate
sysctl.conf in /system/etc
If it's not in this directory, create it.
Step 2
In your sysctl.conf file, paste the following code and save it.
Code:
#sysctl.conf file
fs.nr_open=1053696;
fs.inotify.max_queued_events=32000;
fs.inotify.max_user_instances=256;
fs.inotify.max_user_watches=10240;
fs.lease-break-time=10;
fs.file-max=165164;
kernel.threads-max=525810;
kernel.random.write_wakeup_threshold=256;
kernel.random.read_wakeup_threshold=128;
kernel.panic=5;
kernel.sched_compat_yield=1;
kernel.panic=0;
kernel.panic_on_oops=1;
kernel.msgmni=2048;
kernel.msgmax=64000;
kernel.shmmni=4096;
kernel.shmall=2097152;
kernel.shmmax=268435456;
kernel.sem='500 512000 64 2048';
kernel.sched_features=24189;
kernel.hung_task_timeout_secs=30;
kernel.sched_latency_ns=18000000;
kernel.sched_min_granularity_ns=1500000;
kernel.sched_wakeup_granularity_ns=3000000;
kernel.sched_shares_ratelimit=256000;
kernel.sched_child_runs_first=0;
fs.lease-break-time=10;
fs.file-max=65536;
net.core.wmem_max=524288;
net.core.rmem_max=524288;
net.core.rmem_default=262144;
net.core.wmem_default=262144;
net.core.optmem_max=20480;
net.unix.max_dgram_qlen=50;
net.ipv4.tcp_keepalive_time=900;
net.ipv4.tcp_keepalive_probes=5;
net.ipv4.tcp_keepalive_intvl=156;
net.ipv4.tcp_timestamps=0;
net.ipv4.tcp_sack=1;
net.ipv4.tcp_fack=1;
net.ipv4.tcp_window_scaling=1;
net.ipv4.tcp_tw_recycle=1;
net.ipv4.tcp_tw_reuse=1;
net.ipv4.tcp_congestion_control=cubic;
net.ipv4.tcp_syncookies=1;
net.ipv4.conf.all.rp_filter=1;
net.ipv4.conf.default.rp_filter=1;
net.ipv4.tcp_synack_retries=2;
net.ipv4.tcp_syn_retries=2;
net.ipv4.tcp_max_syn_backlog=1024;
net.ipv4.tcp_max_tw_buckets=16384;
net.ipv4.icmp_echo_ignore_all=1;
net.ipv4.icmp_ignore_bogus_error_responses=1;
net.ipv4.tcp_no_metrics_save=1;
net.ipv4.tcp_fin_timeout=15;
net.ipv4.tcp_keepalive_intvl=30;
net.ipv4.tcp_keepalive_probes=5;
net.ipv4.tcp_keepalive_time=1800;
net.ipv4.ip_forward=0;
net.ipv4.conf.default.accept_source_route=0 ;
net.ipv4.conf.all.accept_source_route=0;
net.ipv4.conf.all.accept_redirects=0;
net.ipv4.conf.default.accept_redirects=0;
net.ipv4.conf.all.secure_redirects=0;
net.ipv4.conf.default.secure_redirects=0;
net.ipv4.udp_rmem_min=6144;
net.ipv4.udp_wmem_min=6144;
net.ipv4.tcp_rfc1337=1;
net.ipv4.ip_no_pmtu_disc=0;
net.ipv4.tcp_ecn=0;
net.ipv4.route.flush=1;
net.ipv4.tcp_rmem='6144 87380 524288';
net.ipv4.tcp_wmem='6144 87380 524288';
net.ipv6.conf.default.use_tempaddr=2;
net.ipv6.conf.all.use_tempaddr=2;
net.ipv6.conf.all.temp_prefered_lft=3600;
net.ipv6.conf.default.temp_prefered_lft=3600;
vm.dirty_ratio=90;
vm.dirty_background_ratio=80;
vm.oom_kill_allocating_task=1;
vm.overcommit_memory=1;
vm.page-cluster=3;
vm.drop_caches=3;
vm.min_free_kbytes=4096;
vm.panic_on_oom=0;
vm.dirty_expire_centisecs=1000;
vm.dirty_writeback_centisecs=2000;
vm.oom_kill_allocating_task=0;
vm.vfs_cache_pressure=10;
vm.min_free_order_shift=4;
vm.laptop_mode=0;
vm.block_dump=0;
Step 3
Now we need to enable it. So, navigate to /system/etc/init.d and create a file with the following code:
Code:
#!/system/bin/sh
# grep sysctl /etc/init.d/*
# Load /sys/etc/sysctl.conf
sysctl -p
sysctl -p is what initializes the code.
Just FYI: You don't actually need these lines:
Code:
# grep sysctl /etc/init.d/*
Code:
# Load /sys/etc/sysctl.conf
So this would have just sufficed.
Code:
#!/system/bin/sh
sysctl -p
If the above code does not work for any reason, try this:
Code:
#!/system/bin/sh
sysctl -p /system/etc/
Name your file something like this 10sysctl
Save your file.
NOTE: Your ROM must support init.d. You can do this by using dsixda's android kitchen
Step 4
Save your ROM and install it via recovery
OR
you could just push the files into your current ROM and try them out.
----------- For knowledge -----------​
Credits to imoseyon for portions of the info​
Ok, so what exactly is sysctl.conf?
The sysctl.conf is a configuration file for "sysctl" which is an interface for dynamically changing kernel parameters in the Linux OS. The configuration file contains the following elements, vm.min_free_kbytes, vm.dirty_ratio, vm.dirty_backgroud_ratio, vm.vfs_cache_pressure, vm.oom_kill_allocating_task. There are many other elements within the file, but we will be primarily focusing on these specifically (the vm prefix stands for virtual memory). The sysctl.conf file should be located in /etc (/system/etc) by default. To enable it you need your ROM to execute "sysctl -p" somewhere during the boot process (or shortly afterward). We will also be discussing how to enable it if it is not already done so. You can also run sysctl -p manually to enable it any time after the OS is started.
Now, let’s get down to what sysctl.conf does and how it works.
min free kbytes (vm.min_free_kbytes)
This is used to force the Linux VM to keep a minimum number of kilobytes free. The VM uses this number to compute a pages_min value for each lowmem zone in the system. Each lowmem zone gets a number of reserved free pages based proportionally on its size. Default is 2048kb.
dirty ratio (vm.dirty_ratio) and dirty background ratio (vm.dirty_background_ratio)
This controls how often the kernel writes data to "disk" (in our case the internal microSD system card, not the removable microSD card). When your apps write data to disk, Linux actually doesn't write the data out to the disk right away, it actually writes the stuff to system memory and the kernel handles when and how the data is actually going to be flushed to the disk. These values represent a percentage, the higher the percentage, the longer it waits to flush, the lower the percentage, the more often flushes will occur. Now remember, we are dealing with solid state storage, not the traditional disk platter and spindle. So we are actually able to delay flushes a little longer with solid state versus a traditional hard drive disk.
VFS Cache Pressure
Now here is where it gets interesting! File system cache (dentry/inode) is really more important than the block cache above in dirty ratio and dirty background ratio, so we really want the kernel to use up much more of the RAM for file system cache, this will increas the performance of the system without sacrificing performance at the application level. The default value is 100, as a percentage, and what you want to do is lower the value to tell the kernel to favor the file system cache and not drop them aggressively.
oom allocating task (vm.oom_kill_allocating_task)(enable or disable, generally in Linux this value is either a "1" or a "0," representing as on or off.)
This enables or disables killing the OOM-triggering task in out-of-memory (oom) situations. If this is set to zero, or disabled, the OOM killer will scan through the entire task list and select a task based on heuristics to kill. This normally selects a rogue memory-hogging task that frees up a large amount of memory when killed. If this is set to non-zero, or enabled, the OOM killer simply kills the task that triggered the out-of-memory condition. This avoids the expensive task list scan, which can take mass amounts of time and "hang" or freeze the system.
block_dump (vm.block_dump)
This enables block I/O debugging when set to a nonzero value. If you want to find out which process caused the disk to spin up (see /proc/sys/vm/laptop_mode), you can gather information by setting the flag.
When this flag is set, Linux reports all disk read and write operations that take place, and all block dirtyings done to files. This makes it possible to debug why a disk needs to spin up, and to increase battery life even more. The output of block_dump is written to the kernel output, and it can be retrieved using "dmesg". When you use block_dump and your kernel logging level also includes kernel debugging messages, you probably want to turn off klogd, otherwise the output of block_dump will be logged, causing disk activity that is not normally there.
overcommit_memory (vm.overcommit_memory)
This controls overcommit of system memory, possibly allowing processes to allocate (but not use) more memory than is actually available.
0 - Heuristic overcommit handling. Obvious overcommits of address space are refused. Used for a typical system. It ensures a seriously wild allocation fails while allowing overcommit to reduce swap usage. root is allowed to allocate slighly more memory in this mode. This is the default.
1 - Always overcommit. Appropriate for some scientific applications.
2 - Don't overcommit. The total address space commit for the system is not permitted to exceed swap plus a configurable percentage (default is 50) of physical RAM. Depending on the percentage you use, in most situations this means a process will not be killed while attempting to use already-allocated memory but will receive errors on memory allocation as appropriate.
page-cluster (vm.page-cluster)
This controls the number of pages which are written to swap in a single attempt. The swap I/O size.
It is a logarithmic value - setting it to zero means "1 page", setting it to 1 means "2 pages", setting it to 2 means "4 pages", etc.
The default value is three (eight pages at a time). There may be some small benefits in tuning this to a different value if your workload is swap-intensive.
panic_on_oom (vm.panic_on_oom)
This enables or disables panic on out-of-memory feature. If this is set to 1, the kernel panics when out-of-memory happens. If this is set to 0, the kernel will kill some rogue process, by calling oom_kill().
Usually, oom_killer can kill rogue processes and system will survive. If you want to panic the system rather than killing rogue processes, set this to 1.
The default value is 0.
Panic is a system error that is detected by the kernel.
dirty_expire_centisecs (vm.dirty_expire_centisecs)
How old "dirty" data should be before the kernel considers it old enough to be written to disk. It is expressed in 100ths of a second.
dirty_writeback_centisecs (vm.dirty_writeback_centisecs)
This is the interval of when the writeback daemons periodically wake up and write "old" data out to disk. It is expressed in 100ths of a second.
Click to expand...
Click to collapse
source:
http://forum.xda-developers.com/showthread.php?t=1621808
i use juice defender...with okayish usage, i got 3 days and 1 hour(1 time thing).....with my normal usage i get 24+ hours......
would have given this a try had there been just a .zip file
it comes with a zip file but flash at your own risk
Code:
http://www.androidfilehost.com/main/Incredible_Developers/PureMotive/Mods/Universal/Sysctl-conf.zip
i just saw this thread and see it really interesting as we all love longer battery life
it was classified as universal but i have not flashed file yet and am hoping first feedbacks about this from developers in our phone model
noypi_ako said:
it comes with a zip file but flash at your own risk
Code:
http://www.androidfilehost.com/main/Incredible_Developers/PureMotive/Mods/Universal/Sysctl-conf.zip
i just saw this thread and see it really interesting as we all love longer battery life
it was classified as universal but i have not flashed file yet and am hoping first feedbacks about this from developers in our phone model
Click to expand...
Click to collapse
I cannot flash it (status 0) in my MIUI 10.5...
tomjoad2 said:
I cannot flash it (status 0) in my MIUI 10.5...
Click to expand...
Click to collapse
Replace the meta-inf folder with the one in your rom zip file
Cheers
Sent from my GT-i9003 powered by Stable and Smooth CleanKpu rom
I had problems installing the zip on UC kernel stock rom. Nonetheless the kind of hack proposed in this mod should work here as well. It makes sense. Is anyone able to fix it?
it was mentioned by the developer that the best to do it is manually
and that custom rom developers can implement it on their roms
Those having status 0 error: replace the meta-inf folder in the flashable zip with the one in your rom
Cheers
Sent from my GT-i9003 powered by Stable and Smooth CleanKpu rom
bscraze said:
Those having status 0 error: replace the meta-inf folder in the flashable zip with the one in your rom
Cheers
Sent from my GT-i9003 powered by Stable and Smooth CleanKpu rom
Click to expand...
Click to collapse
thanks...done, but now I get error (status 7)
tryng to do it manually
i think it would be best if we hear feedbacks first from our kernel/rom developers of i9003
Even though sysctl.conf accepts ";", it breaks the conf file and sysctl can't parse it.
Use this instead:
http://pastebin.com/raw.php?i=3tDgbmG3
EDIT:
This file is simply the one in the OP without ";".
FYI some of its values overwrite the values used by kernel developers.
EDIT 2:
And without single quotes.
loSconosciuto said:
Even though sysctl.conf accepts ";", it breaks the conf file and sysctl can't parse it.
Use this instead:
http://pastebin.com/raw.php?i=3tDgbmG3
Click to expand...
Click to collapse
Done manually... but when I try to review with sysctl -a| grep vm cannot see any changes
tomjoad2 said:
Done manually... but when I try to review with sysctl -a| grep vm cannot see any changes
Click to expand...
Click to collapse
Sorry, I didn't notice the single quotes in sysctl.conf
File updated (same link).
loSconosciuto said:
Sorry, I didn't notice the single quotes in sysctl.conf
File updated (same link).
Click to expand...
Click to collapse
Still nothing...maybe sysctl -p cannot activate the script...
tomjoad2 said:
Still nothing...maybe sysctl -p cannot activate the script...
Click to expand...
Click to collapse
deeper part of the first post
developer said if this dont work
Code:
#!/system/bin/sh
sysctl -p
then try this
Code:
#!/system/bin/sh
sysctl -p /system/etc/
tomjoad2 said:
Still nothing...maybe sysctl -p cannot activate the script...
Click to expand...
Click to collapse
It should work. Maybe you don't have /etc, but only /system/etc (/etc is just a symlink)
If you run
Code:
sysctl -p
you should get as output the content of sysctl.conf
If you get
Code:
sysctl: /etc/sysctl.conf: No such file or directory
Try with
Code:
sysctl -p /PATH/TO/THE/FILE/sysctl.conf
Where /PATH/TO/THE/FILE/ is, of course, the path to sysctl.conf,
noypi_ako said:
deeper part of the first post
developer said if this dont work
Code:
#!/system/bin/sh
sysctl -p
then try this
Code:
#!/system/bin/sh
sysctl -p /system/etc/
Click to expand...
Click to collapse
This is what I get
and when a write sysctl -p then ---> sysctl: short write
tomjoad2 said:
This is what I get
and when a write sysctl -p then ---> sysctl: short write
Click to expand...
Click to collapse
i believe loSconosciuto is highly qualified for this one
many thanks to him for looking into this mod
Code:
ls -l /proc/sys/net/ipv4/route/flush
--w------- 1 root root 0 Apr 28 14:26 /proc/sys/net/ipv4/route/flush
That means no one can read the content of this file, even 'root'. That's why you get
Code:
sysctl: error reading key 'net.ipv6.route.flush': Permission denied
sysctl: error reading key 'net.ipv4.route.flush': Permission denied
sysctl tries to read it, but it can't.
tomjoad2 said:
This is what I get
and when a write sysctl -p then ---> sysctl: short write
Click to expand...
Click to collapse
Are you sure your sysctl.conf is correct? Did you remove all the ";" and "'"?
loSconosciuto said:
Code:
ls -l /proc/sys/net/ipv4/route/flush
--w------- 1 root root 0 Apr 28 14:26 /proc/sys/net/ipv4/route/flush
That means no one can read the content of this file, even 'root'. That's why you get
Code:
sysctl: error reading key 'net.ipv6.route.flush': Permission denied
sysctl: error reading key 'net.ipv4.route.flush': Permission denied
sysctl tries to read it, but it can't.
Are you sure your sysctl.conf is correct? Did you remove all the ";" and "'"?
Click to expand...
Click to collapse
would it work if we chmod 644 those file?

[HOW-TO] Some tweaks to sweeten your life with the Infinity a little

Hi everybody, I would like to share my experiences with the Infinity and ask you guys to share your opinions, thoughts and ideas on tweaking it. Hopefully we can sort something out together.
Please remember that you can brick your tablet with any of these methods and lose your warranty too and be the one solely responsible for it. I have not bricked mine, so I am writting all of this with best intentions . Proceed with caution and only if you are sure that your Infinity not booting will not lead you to jumping off a high building! Seriously.
Ok, here it goes.
Hit [THANKS] if it helps.
Seems this thread somehow got to the News, so special thanks go to Joe and those of you who have reported it newsworthy. I'm glad I could've helped you with this!
Remember 1) you'll have to do most of these each time you update firmware / change ROM and 2) go back to stock /system files every time before you apply an OTA update, as it does various checks on /system integrity now.
1. ROOT
Don't use ASUS Device Tracker! (see point 6. below)
Install SuperSU and follow these steps before updating to the Jelly Bean to preserve root (thanks to nooktablet for posting this). Others said that Superuser app combined with RootKeeper sufficed, so do as you wish.
DroidEris1981 has reported that in his case on the .30 firmware he was only able to root his Infinity using an older version of Debugfs and only when pausing it at each reboot, waiting for the device to fully boot up before the next step.
So far the only rooting method that works is the Debugfs method by sparkym3. By rooting you can boost your Infinity's performance a bit, including its poor I/O results, and much, much more (see threads on reasons for rooting and apps).
Once again: ROOT BEFORE UPDATING TO THE JB!
If you've failed to do this, however, there is still a way to work things out - see the first few posts in this thread if you're under unrooted JB now.
In case you experience problems using this method, you may try one of the solutions described in this thread, but as there is a new 2.2 version now, you should be good just using it.
Some need to RUN the Superuser app first before it starts working. And remember about BusyBox, it comes handy in many situations, especially if you are going to use the shell. And you can use SuperSU instead of the "default" Superuser app.
RootKeeper might come in handy when updating firmware on a rooted Infinity.
1.1. We have the unlocking tool now, and a few custom ROMs in the development section.
2. I/O scheduler [only after rooting your device] OBSOLETE
Since the .26 update and under the JB as well cfq is the default scheduler and better than non-stock sio, so no reason to change the scheduler at this point already on >= 9.4.5.26 firmware!
After a day of using JB I can say that (stock) noop is slightly faster than cfq for most uses.
[REMOVED]
3. build.prop tweaks ("/system/build.prop" file)
These are for the ICS. We'll all have to see how these perform under the JB. So far changing the DPI via build.prop has been confirmed to be obsolete.
EDIT 22.12.2013 Deleted several obsolete entries, see LaraCroft304's post for reference.
I have used various suggestions as a reference, incl. demandarin's tweaks for the Prime (just search "build.prop tweaks" on xda and read about what these tweaks do). I am still unsure of some of them, e.g. the proper heap size instead of the default 256m (or maybe we should leave it be?). The tweaks I'm using are the following.
Edit: I'm leaving the default heap size, I think it's better for the games.
Lines to EDIT:
#an old proposal, which seems to be of no use
#dalvik.vm.dexopt-flags=m=v,o=y
dalvik.vm.dexopt-flags=v=n,o=a,u=y
#In case you experience problems with some apps after this, try (unhash) this instead:
#dalvik.vm.dexopt-flags=v=a,o=v,u=y,m=y
#(you can also see, for example, this thread for instructions)
# optional: CHANGE SCREEN RESOLUTION / PIXEL DENSITY (so that your screen can become more capacious)
# ro.sf.lcd_density = 160
Lines to ADD:
# BATTERY SAVING
pm.sleep_mode=1
wifi.supplicant_scan_interval=180
# UI & GENERAL PERFORMANCE
ro.kernel.android.checkjni=0
persist.sys.strictmode.visual=0
persist.sys.strictmode.disable=1
dalvik.vm.execution-mode=int:jit
com.ti.omap_enhancement=true
# MEDIA QUALITY & PERFORMANCE
media.stagefright.enable-player=true
media.stagefright.enable-meta=true
media.stagefright.enable-scan=false
media.stagefright.enable-http=true
ro.media.enc.jpeg.quality=90
ro.media.enc.hprof.vid.bps=8000000
persist.sys.use_dithering=1
# NETWORK PERFORMANCE
# there are different types of advice here, you can try what work's best for you out of the latter two (just delete all the spaces which xda keeps adding!):
net.tcp.buffersize.default=4096,87380,256960,4096,16384,256960
#net.tcp.buffersize.wifi=4096,87380,256960,4096,16384,256960
net.tcp.buffersize.wifi=262144,524288,1048576,262144,524288,1048576
# SWITCHING SOME NOTIFICATIONS OFF
# disable sending usage data
# disable adb notifications
persist.adb.notify=0
# FAST REBOOT
persist.sys.purgeable_assets=1
# you can also unhash this and disable boot animation for faster boot:
# debug.sf.nobootanimation=1
# This is for current, Wi-Fi only version of Infinity of course:
ro.carrier=wifi-only
# Just for those who need it - unhash the following line to make your device run all ADB shell and terminal emulator commands as ROOT by default (use with caution)
# ro.secure=0
3.1. You can edit the build.prop file manually, you can use one of a few apps out there to manage it, but I have found manually mounting the system r/w (and r/o again after changing the file) and editing it through a PC (you can use Dropbox) or the Infinity with the dock most helpful - you can just cp the new file to (remember to make a backup copy of the old file just in case!).
If you like using the term, you can just 'su' and write these commands:
a) R/W before edit:
mount -o rw,remount /system
b) R/O after edit (remember to run 'chmod 644 /system/build.prop' as root before remounting /system R/O):
mount -o ro,remount /system
3.2. Remember to reboot your device after changing the file. Clearing dalvik-cache won't hurt either.
Edit: Actually I highly recommend wiping dalvik cache to avoid bootloops (as root: rm /data/dalvik-cache/*) <- and then.reboot
4. Minfree tweaks:
You can either change the values in /sys/module/lowmemorykiller/parameters/minfree (remember these are pages, so 1024 means 4MB!) or use any of the apps from the Playstore meant for that. I'm using System Tuner for things like that (look for Tweaks / Auto-Kill in the app). You might set anything you like, possibly 8,16,200,220,240,275 MB proposed by the author of the (messy) SuperCharge script for the 1GB RAM devices (based on a minfree calculator by another XDA member). I have it currently set on 8,16,32,128,192,192 MB, which seems aggressive enough.
You can read more about it and what these values mean here.
You can also have a look at my thread on battery life.
5. Disable "smart dimmer", which is the reason you can see some screen flickering when changing between light and dark backgrounds that many find annoying (described by some as "dynamic contrast", which it resembles):
Can be done through SYSTEM SETTINGS under the JB, so no need to do this manually anymore.
To disable:
echo 0 > /sys/devices/tegradc.0/smartdimmer/enable
To re-enable echo 1 to the this file or simply reboot.
Be sure to include this in a script so that rebooting won't change it (just make an .sh script with the above line in it, you can use either SManager or system .sh scripts (you can use my simple solution posted here if you don't like editing files yourself). See also jtrosky's hints on changing the brightness settings.
Please note that it may negatively affect your battery life, although with brightness set low it shouldn't be much worse.
All credit goes to those who have found out about it - see this post for details.
6. Disable remote management that allows ASUS (or anybody in charge of their servers) to track, lock or wipe your device over-the-air or steal your data, which has been confirmed ASUS is doing: read the whole story about warranty voided because of rooting here.
7. Install Volume+ or a similar app to boost your device's sound level (you can register here to get the full version for free, but if it helps, support the developer). And remember to change the audio device in the system audio settings to Volume+!
8. Other tweaks, init.d, scripts etc.
See the development section for custom ROMs which include various tweaks and for custom recoveries.
9. Some keyboard solutions:
Re-map the browser keyhttp://forum.xda-developers.com/showthread.php?t=1497624 in the dock in order to be able to use your favourite browser or do some custom re-mappings.
In case of problems with diacritics when docked, be sure to use KLSwitcher for setting your locale.
Finally, not really a tweak, but something that a lot of users find helpful: KEYBOARD SHORTCUTS.
10. Remove bloatware (see the first few posts with further links here).
11. Set background processes to max. 4 in the dev. settings for better stability (that's true for the ICS at least).
<----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
And remember, at the end of the day, when you're done tweaking, you should disable USB debugging if you don't want to get hacked.​
Hit [THANKS] if it helps.
Thank you for this! I'll have to try some of these out when I pick up my tablet.
i remember reading about some 300 users using, browser2ram (i think that's what its called) for a better internet browsing experience.
denniegst said:
i remember reading about some 300 users using, browser2ram (i think that's what its called) for a better internet browsing experience.
Click to expand...
Click to collapse
Can you give us a link? Google is not helpful with this name you mentioned (browser2ram).
http://forum.xda-developers.com/showpost.php?p=25286407&postcount=61
i think it only works on stock browser, but i could be wrong. and since everything is sent to the ram, once the tablet resets everything will be lost: browser history settings etc
denniegst said:
http://forum.xda-developers.com/showpost.php?p=25286407&postcount=61
i think it only works on stock browser, but i could be wrong. and since everything is sent to the ram, once the tablet resets everything will be lost: browser history settings etc
Click to expand...
Click to collapse
Thanks, that sounds interesting, but I am not sure there is a need for it on the Infinity. Dolphin HD performs exceptionally well (thanks for the info, ray3andrei: http://forum.xda-developers.com/showthread.php?t=1752809&page=2).
Edit: Can't recommend Dolphin anymore due to serious privacy issues.
Hi
Correct me if i'm wrong:
1. install the drivers if they are not installed allready
2. tick usb debugging
3. tick unknown sources
4. unzip DebugfsRoot_v1.8
5. connect tab to pc
6. run RootDebugfs.bat
7. select option 1 -Root
8. since haven't go further this step, i don't know what's next till rebooting
that's it? device rooted?
i have a little experience in rooting cause i have rooted my galaxy s a few times, but that phone is almost unbrickable
i just want to be sure i'm doing it right
thanks
dobranszky said:
Hi
Correct me if i'm wrong:
1. install the drivers if they are not installed allready
2. tick usb debugging
3. tick unknown sources
4. unzip DebugfsRoot_v1.8
5. connect tab to pc
6. run RootDebugfs.bat
7. select option 1 -Root
8. since haven't go further this step, i don't know what's next till rebooting
that's it? device rooted?
i have a little experience in rooting cause i have rooted my galaxy s a few times, but that phone is almost unbrickable
i just want to be sure i'm doing it right
thanks
Click to expand...
Click to collapse
Yep, that's basically it
Then it reboots a few times while pushing some files through adb, you get the Superuser program installed etc. After a few minutes you should have a rooted Infinity.
However, it will be much more fun after installing BusyBox from the Market/Play. It gives you a bunch of commandline tools to play with.
Just remember to charge your device and not to connect any other Android device while rooting.
I don't understand why you are using the 1.8 version when the 1.9 is there. I used 1.9 to root without any problems.
Alkzn said:
I don't understand why you are using the 1.8 version when the 1.9 is there. I used 1.9 to root without any problems.
Click to expand...
Click to collapse
There are links to both in the thread I was referring too. Actually I don't see any harm in using 1.8, as 1.9 is just updated Superuser app, which will update itself from Google Play anyway (they had some problems uploading the file to xda btw)
Hi fellow Infinity-Users!
I tried both versions (1.8/1.9), and both equally worked/failed with my (european) TF700.
The issue that actually broke the batch-script was adb wait-for-device, which just seemed to catch a timeout after waiting for the tablet to reboot.
As there is little magic in that script, you can safely execute all it does by hand (basically all the lines involving adb). That's the way I just rooted my TF700 and it worked like a charm.
Alternatively, if you don't feel comfortable with executing the adb actions by hand, you might want to just replace all occurrences of
Code:
adb wait-for-device
with
Code:
pause
(or something like that.)
Then you will have to hit enter (or some other key) each time once the tablet has rebooted.
What is actually needed for rooting:
Wait for your tablet to be fully booted up.
In a terminal execute the following commands in the folder you unpacked the rooting stuff to:
Code:
adb kill-server
REM as we are not rebooting and we don't hit a timeout, the first wait works
adb wait-for-device
adb push debugfs /data/local/
adb push su /data/local/
adb push debugfsinput /data/local/
adb shell mv /data/local/tmp /data/local/tmp.bak
adb shell ln -s /dev/block/mmcblk0p1 /data/local/tmp
adb reboot
REM Wait for the tablet to reboot
pause
adb shell chmod 777 /data/local/debugfs
adb shell "/data/local/debugfs -w /dev/block/mmcblk0p1 < /data/local/debugfsinput"
adb shell rm /data/local/tmp
adb shell mv /data/local/tmp.bak /data/local/tmp
adb shell rm /data/local/su
adb shell rm /data/local/debugfs
adb shell rm /data/local/debugfsinput
adb reboot
pause
REM Wait for the tablet to reboot
Now check the if you've got a rootshell - thus the given uid and gid of the are indeed root (0). make sure to remove the REM from the first or second part, if needed
You do this eg. by executing:
Code:
adb shell "/system/xbin/su -c id"
If you are root, install the Superuser Management Toolpack:
Code:
adb install Superuser.apk
adb reboot
Else cleanup:
Code:
adb shell /data/local/nachoroot.bin --undo > nul
adb reboot
Hope this cleared things up a little!
(all commands are taken from the script. If someone feels this is undesirable to post here, please let me know, I'll remove that immediately. Thanks to sparkym3, miloj and viperboy for giving me root-power !)
Thanks, that's interesting, I have the "European" version, as you called it, or rather WW firmware, and the script worked perfectly for me.
d14b0ll0s said:
Thanks, that's interesting, I have the "European" version, as you called it, or rather WW firmware, and the script worked perfectly for me.
Click to expand...
Click to collapse
True, I'm running WW_epad-9.4.5.21-20120601. From what I've seen so far, the issue seems not to be related to the tablet, but seems to be some issue with the OS adb is run on. In my case this is win7x64. What OS are you running? Would be interesting to track this down for others who may run into this issue in the future .
burningcf said:
True, I'm running WW_epad-9.4.5.21-20120601. From what I've seen so far, the issue seems not to be related to the tablet, but seems to be some issue with the OS adb is run on. In my case this is win7x64. What OS are you running? Would be interesting to track this down for others who may run into this issue in the future .
Click to expand...
Click to collapse
Good point. Unfortunately, the OS version trace seems to lead to nowhere, as I'm on Win 7 x64 too... perhaps something else then?
Run on balanced no matter what, everything runs better, and the tablet seems to not get stuck anymore or lag while downloading... so for the love of your infinity run on balanced instead of performance
Sent from my Jelly Beaned GNexus
ray3andrei said:
Run on balanced no matter what, everything runs better, and the tablet seems to not get stuck anymore or lag while downloading... so for the love of your infinity run on balanced instead of performance
Click to expand...
Click to collapse
I had good experience with "balanced" too, but if you compare it to benchmarks you can see that actually some operations are faster in "performance": mostly GPU, but not only that - RL Benchmark (SQLite Performance) is 110 in balanced instead of <90, reading & writing speeds are often faster in "performance" etc. But I agree it is the best mode to be running in everyday use, mostly because of power/battery *balance* and governing the CPU.
d14b0ll0s said:
I had good experience with "balanced" too, but if you compare it to benchmarks you can see that actually some operations are faster in "performance": mostly GPU, but not only that - RL Benchmark (SQLite Performance) is 110 in balanced instead of <90, reading & writing speeds are often faster in "performance" etc. But I agree it is the best mode to be running in everyday use, mostly because of power/battery *balance* and governing the CPU.
Click to expand...
Click to collapse
i really cant seem to get better gpu performance,,, quite the contrary i get better o balanced
Sent from my Asus Transformer Pad Infinity
I used sparky root on my prime and my tf300. Question. Can I use sparky root on my tf700 or will I need to do the debugfs method? If I have to use the debugfs method is there a step by step link?
leroybrute said:
I used sparky root on my prime and my tf300. Question. Can I use sparky root on my tf700 or will I need to do the debugfs method? If I have to use the debugfs method is there a step by step link?
Click to expand...
Click to collapse
So far only Debugfs has been confirmed to be working.
You might find either of these useful:
http://forum.xda-developers.com/showthread.php?t=1706588
http://forum.xda-developers.com/showpost.php?p=28490040&postcount=8
Thank you

[LOS][SWAP][MEM] Snappier than ever

NOTE: BEFORE SAYING "yet another memory swapping evangelist", WATCH THE VIDEO: https://youtu.be/sdeKuPiR4II
I have been doing some research on system responsiveness with my good old Mofo Z. Then arrived at this.
24 hours after having configured:
LineageOS 15.1 (root enabled)
Swap file size = 4GB (in /data/swap)
vm.swap_ratio = 100 (default)
vm.swap_ratio_enable = 1
vm.swappiness = 75
I have achieved the readings contained in the attached screenshots, and the system acts snappier than ever. It's actually running pretty cool.
First I enabled init.d processing by adding an RC file to init, then created userinit.sh with the necessary systcl and swapon commands.
No system files were changed (new files were added only), so after an update the configuration won't revert to the original state (swap-less).
The least used pages (some [almost] never used) are being written to the swap file and therefore more room for active code (and cached apps) is made available.
It's almost like I had an 8GB RAM bastard in my hand. This with around 130 apps loaded.
STEPS USED
File init_d.rc was created (as described in https://forum.xda-developers.com/lineage/general/how-to-enable-init-d-to-function-t3810355)
Executed:
Code:
$ su
# cd /data
# mkdir swap
# cd swap
# dd if=/dev/zero of=swapfile bs=1048576 count=4096
# mkswap swapfile
Created /data/local/userinit.sh (called from within already existing /system/etc/init.d/90userinit) with the code:
Code:
#!/system/sbin/sh
# vm_swap_ratio=100 is default, no need to set
sysctl vm.swap_ratio_enable=1
sysctl vm.swappiness=75
swapon /data/swap/swapfile
Rebooted and let the system run for a few hours. Things only get better with uptime/usage.
The best part is that you can unroot afterwards and have it still working.
Merry Christmas!
thanx 4 ur work but i m newbie i dont understand what is for , what makes this for this device
murteci said:
thanx 4 ur work but i m newbie i dont understand what is for , what makes this for this device
Click to expand...
Click to collapse
It's for making your device multitasking better. Watch the video: https://youtu.be/sdeKuPiR4II
Guess what? The Galaxy Note 9 (SM-N9600, 6GB/128GB version) employs memory swapping. It has a 2GB active swap file right out of the box.
I received mine last friday, updated Android and went to check it out after I noticed it behaved and reported much like LineageOS with my mod applied. Then I installed a terminal emulator (no root needed) and ran "free -m".
Bang! The swapping is there!
Can't wait to root it and verify that the swappiness is set to... 75. Kinda keen those Samsung guys, huh? Heheheh.
Whammamoosha said:
Guess what? The Galaxy Note 9 (SM-N9600, 6GB/128GB version) employs memory swapping. It has a 2GB active swap file right out of the box.
I received mine last friday, updated Android and went to check it out after I noticed it behaved and reported much like LineageOS with my mod applied. Then I installed a terminal emulator (no root needed) and ran "free -m".
Bang! The swapping is there!
Can't wait to root it and verify that the swappiness is set to... 75. Kinda keen those Samsung guys, huh? Heheheh.
Click to expand...
Click to collapse
Can Make this tutorial to Video Tutorial on Youtube ?
Whammamoosha said:
It's for making your device multitasking better. Watch the video:
Click to expand...
Click to collapse
it looks fantastic, but does it wear the internal storage after time?
JuniorCaesar said:
it looks fantastic, but does it wear the internal storage after time?
Click to expand...
Click to collapse
Yes it does, everything is a trade-off, there's no such thing as a free lunch.
But the wear level added is roughly same as on a computer SSD, so we're talking about decades of use before everything wears out.
emrebozkurt99 said:
Can Make this tutorial to Video Tutorial on Youtube ?
Click to expand...
Click to collapse
I could, but everything is so simple that it's pretty unnecessary.
. Install terminal emulator app from Play Store
. Run terminal emulator app
. Type "free -m"
. Done!
As for the swap configuration for LOS I'm writing a shell script (BIG) that will handle the configuration as user-friendly as possible. Stay tuned!
Could this be used on a stock rom as well?
SlashSpeed said:
Could this be used on a stock rom as well?
Click to expand...
Click to collapse
This is for LineageOS. For stock ROMs (once rooted) one may make the necessary adaptions.
im noob
Hi, im noob and I followed your instructions (at least what I understood) n_nU
I hope that I did it right, the question is, how can I know that?
old thread, but this may not work for most because the script has a slight error:
Code:
#!/system/sbin/sh
It should be:
Code:
#!/system/bin/sh
then all is well.
justle said:
im noob
Hi, im noob and I followed your instructions (at least what I understood) n_nU
I hope that I did it right, the question is, how can I know that?
Click to expand...
Click to collapse
https://gist.github.com/iGlitch/be70d403ad1cfa42ac7e1d46f1b546db Amend a script to a script to track whether or not it executes. Note: You need to manually create the log folder and logs file in /storage/emulated/0 in order for it to work.
Code:
# Push a semi-needed log to the internal storage with a "report" if the script could be executed or not;
# Script log file location
LOG_FILE=/storage/emulated/0/logs
echo $(date) > /storage/emulated/0/logs/script.log
if [ $? -eq 0 ]
then
echo "Script executed. Enjoy!" >> /storage/emulated/0/logs/script.log
exit 0
else
echo "Script failed!" >> /storage/emulated/0/logs/script.log
exit 1
fi
# Done!
Thanks! Worked like a charm.
I use a bunch of fat apps and this caused a few seconds of load times with almost every app switch.
I'm running LOS 17.1 on gemini with 3GB RAM; swap file defaults to 0.5GB.
I've left
Code:
vm.swap_ratio_enable = 0
vm.swappiness = 60
as it was. Simply adding a new 4GB swap file fixed my daily pain.
I have to provide an update on the charm part. (I've tried other settings from first post too).
Previously system was stuck at fully utilized 500 MB default swap. Every app change (I'm using hungry ones) was a pain.
Now system uses ~300 MB more in swap, and for some use cases user experienced have gotten bettter.
I don't feel like this mode would be complete without changing app killer configuration. Would it even be efficient considering the memory read speed in mi5 (or at all)? Idk.
Bottom line.
If you are unhappy with the performance of your hardware and it's because of RAM and your system are using 100% of swap, then it is probably worth increasing the paging file size.
SyraAB said:
Thanks! Worked like a charm.
I use a bunch of fat apps and this caused a few seconds of load times with almost every app switch.
I'm running LOS 17.1 on gemini with 3GB RAM; swap file defaults to 0.5GB.
I've left
Code:
vm.swap_ratio_enable = 0
vm.swappiness = 60
as it was. Simply adding a new 4GB swap file fixed my daily pain.
Click to expand...
Click to collapse
Hi SyraAB.
I am glad that you successfully create swap and make swap service work, which I think now you are the only one who can solve my problems.
So I did every step that Whammamoosha said. However, I failed. When I check whether there was swap created using free -m in Termux there was nothing. Then I dig something out from some research. Here is my question:
1)
Whammamoosha said:
Created /data/local/userinit.sh (called from within already existing /system/etc/init.d/90userinit) with the code:
Click to expand...
Click to collapse
It appears that I don't have file 90userint under /system/etc/init.d (by the way I believe Whammamoosha meant /system/etc/init here because init.d does not exist in android). Also I notice your ROM is Lineage OS 17.1, which is the same as mine. So I am curious how did you make that work without file 90userinit.
2)
To my best knowledge that sysinit is killed in Los 17.1. There is a post on Reddit regarding to enable init.d on Los 17.1. Link is here. What makes me more curious is that how did you manage to make all things work without some key files? If you don't mind could you tell me how did you successfully create swap?
My phone is HTC m8 running on Lineage os 17.1.
Thanks in advance
Hello mrdet,
I didn't configure applying new swap on startup at all, so I didn't dance around absent init.d.
Increasing the paging file consist of two steps.
1. Create a file to be used as swap. This needs to be done once, as file persist after reboot.
Spoiler: mkswap example
Bash:
cd /data
mkdir swap
cd swap
# create swap file
dd if=/dev/zero of=swapfile bs=1048576 count=4096
mkswap swapfile
2. Activate it. This needs to be done after every reboot.
Spoiler: swapon example
Bash:
swapon /data/swap/swapfile
Hope this helps.

Categories

Resources