Jump to content

[ALL] [MOD/Other] Disable/Enable *SWAP *zRam *Fstrim


Recommended Posts

Guest Victod
Posted

hwy just out of curiosity, will this method work on any device??

 

Not really, first is needed a kernel with swap and zram support *obviously* Busybox too is needed 
 
and SWAP scripts should be ajusted acording to the device's specificactions, I mean to the swap file size...
 
zRAM isn't always located at the same place on all devices, so it is need to be ajusted too...
Guest farfix
Posted

 

My Sysctl-Preferences.
 
To end, here a script with my SysCtl preferences like swappiness, min_free_kbytes, read_ahead_kb...
 
 
 
 
 
That's all! Greetings!

 

 

¿Qué hace esto? no entiendo muy bien esta parte, pero me parece interesante :)

 

[What this does? I don't understand very well this part... But looks interesting :) ]

Guest Victod
Posted

¿Qué hace esto? no entiendo muy bien esta parte, pero me parece interesante :)

 

[What this does? I don't understand very well this part... But looks interesting :) ]

 

Son solo ajustes o tweaks para mejorar un poco el rendimiento...

 

Esos ajustes los tome del script V6 Supercharger de @zeppelinrox

Guest farfix
Posted

Son solo ajustes o tweaks para mejorar un poco el rendimiento...

Esos ajustes los tome del script V6 Supercharger de @zeppelinrox

Gracias por responder. Por cierto, para que el SWAP sea efectivo debo utilizar el almacenamiento interno en vez de la memoria externa por defecto? O eso no influye?

Guest Victod
Posted

Gracias por responder. Por cierto, para que el SWAP sea efectivo debo utilizar el almacenamiento interno en vez de la memoria externa por defecto? O eso no influye?

 

err... Actually, device internal memory is faster than the most of Micro-SD cards... With these scripts SWAP.file is only created at /System or /Cache (internal memory), if you have a super faster Micro-SD Card like this one then you are free to find a way to use SWAP in your Micro-SD Card because the differences will be huge  :P

 

Regards.

Guest Victod
Posted

Improve SSD performance with fstrim --> FSTRIM(8)

 

It seems that SSD performance decreases over time, since unlike hard disk drives (HDDs), NAND flash memory that make SSD cannot overwrite existing data. This means that you first have to delete the old data before writing new one.

 

Flash memory is divided into blocks, which is further divided in pages. The minimum write unit is a page, but the smallest erase unit is a block. This means that as time goes on, the SSD will internally fragment the blocks among the different pages, until that it reaches a point where there won’t be available any empty page. Then every time the drive needs to write a block into any of the semi-full pages, it first needs to copy the current blocks from the page to a buffer, then it has to delete the whole page to finally rewrite the old blocks along with the new one. This means that as time goes on the SSD performance degrades more and more, because for every write it has to go through a cycle of read-erase-modify-write. This is known as “write amplification”.

 

TRIM was invented for solving this problem, allowing the operating system to tell the SSD which blocks are free in the filesystem. The SSD uses this information to internally “defragment” the blocks and keep free pages available to be written quickly and efficiently.

 

- See more at: http://fcns.eu/2013/09/12/improve-ssd-performance-with-fstrim/#sthash.F96ibMjL.dpuf

Guest Victod
Posted

UPDATE...***

 

now you can disable all you active or vice versa by choosing the right flashable file....
 
and new script -> Fstrim.!
  • 2 weeks later...
Guest SH3H1
Posted (edited)

Is it 'OK' if my cache partition is full when i use swaponV2?

Edit: Nevermind in my CM10.1 cache partitions is used by 75MB,when i look in that folder it showed dalvic cache is using that amount :huh:

Edited by MasterRck
Guest Victod
Posted

Is it 'OK' if my cache partition is full when i use swaponV2?

Edit: Nevermind in my CM10.1 cache partitions is used by 75MB,when i look in that folder it showed dalvic cache is using that amount :huh:

 

Yes, Dalvik Cache at /Cache partition is a CyanogenMod feature... 

Guest ferongr
Posted

Thank you for this. My device's (7275R) stock rom (and there's not any other ROMs arounds, nobody has even built a kernel yet) has an issue where when its idle, the zRAM daemon (kcompcached) will start using a lot of CPU, resulting in less than 10 hours of standby (Samsung's quality software engineering is to blame), preventing the CPU from entering in deep sleep state. The init.d script resulted in noticable improvement in standby drain. Note the difference in discharge rate and CPU usage after the gap when I shut down the system and applied the patch.

post-1040208-0-70291000-1397906793_thumb

 

Re. the fstrim patch: How often is TRIM expected to run? After 4 or 5 hours I've yet to see a trim.log file in /data.

Guest Victod
Posted

Thank you for this. My device's (7275R) stock rom (and there's not any other ROMs arounds, nobody has even built a kernel yet) has an issue where when its idle, the zRAM daemon (kcompcached) will start using a lot of CPU, resulting in less than 10 hours of standby (Samsung's quality software engineering is to blame), preventing the CPU from entering in deep sleep state. The init.d script resulted in noticable improvement in standby drain. Note the difference in discharge rate and CPU usage after the gap when I shut down the system and applied the patch.

attachicon.gifScreenshot_2014-04-19-14-02-061.png

 

Re. the fstrim patch: How often is TRIM expected to run? After 4 or 5 hours I've yet to see a trim.log file in /data.

 

Thanks for feedback!  ^_^

 

...and, partitions are trimmed every system boot. 

Guest EmaGiampa
Posted

Just a question: if I want a bigger swap files? For example 500mb in /system folder, what can I do?

Guest porozex
Posted

Just a question: if I want a bigger swap files? For example 500mb in /system folder, what can I do?

edit the script from 282000something like this to 500000

Guest EmaGiampa
Posted (edited)
edit the script from 282000something like this to 500000
I can't find the value 282000 in any file of the script. Witch file I must modify? Edited by EmaGiampa
Guest porozex
Posted

I can't find the value 282000 in any file of the script. Witch file I must modify?

yeah your right sorry.

download the zip open it and go to bin folder and open the swap file with wordpad then modify this line:

 

system/swap.file bs=1048576 count=250   to>> system/swap.file bs=1048576 count=500

 

pay attention to your total system memory before doing this because if is less than 500mb i dont know what will happen :S

Guest ferongr
Posted

Type "free" in a terminal.

 

Output is as such

127|u0_a181@android:/ $ free
             total         used         free       shared      buffers
Mem:        882696       871744        10952            0         1248
-/+ buffers:             870496        12200
Swap:            0            0            0
Guest EmaGiampa
Posted

u0_a55@u8833:/ $ free

total used free shared buffers

Mem: 401232 392372 8860 0 5544

-/+ buffers: 386828 14404

Swap: 255996 61484 194512

u0_a55@u8833:/ $

Guest EmaGiampa
Posted

Total 400mb... Well, I hoped for use 634mb for reach a 1gb with my 390mb of RAM real. Huawey Y300.

Guest wbrambley
Posted

Is it posable to have more than one swap file? If so maybe we can add one to /cust partition as well. It's only 79 mb but it's wasted space with custom ROMs.

Guest farfix
Posted

How can I check the fstrim state?

I flashed it, wipe dalvik/cache, and restart... but I want to know if that zip worked... :P

Guest Victod
Posted

How can I check the fstrim state?

I flashed it, wipe dalvik/cache, and restart... but I want to know if that zip worked... :P

 

Check log!  ;)

 

"/data/trim.log"

Guest farfix
Posted

Check log!  ;)

 

"/data/trim.log"

 

Thanks! ;)

 

And... the fstrim zip must be flashed only once, right?

 

And thanks again :)

Guest porozex
Posted

Thanks! ;)

 

And... the fstrim zip must be flashed only once, right?

 

And thanks again :)

yes. it runs every boot ;)

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.