Jump to content

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


Guest Victod

Recommended Posts

I never liked zRAM feature in the android devices!  ^_^
 
In most Kitkat ROM for this device, zRAM is enable by default with 50 MB
 
And due to I couldn't repack Boot.img (Kernel) from Kitkat ROMs to disable zRAM, I decided implement one script to disable it.
 
Deactivating zRAM you get a slight boost in performance and extends a bit the battery duration due to is not needed use CPU to compress data in zRAM... (Dont expect much difference)
 
 
 
 
 
The purpose of these scripts is to disable zRAM or Enable SWAP
Without apps and before the first boot, to get a better performance
And improve the first impression of the ROM...
 
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 
  • Disable zRAM

Download this file and install it by recovery.

 
or
Download this file and put it in /etc/init.d folder, then set the right permissions after this, restarts to apply changes.
 
 
  • Disable zRAM Disabler
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 
  • ENABLE SWAP FILE 
This will create a swap file on /system or on /cache partition, depending on which you choose... Just is SWAP
 
Use only one of two method.!
 
05-Swaponboot.zip [249 mb at /System]
 
05-Swaponboot v2.zip [128mb at /Cache]
 
 
  • DISABLE SWAP!
 
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 
  • FSTRIM.!
 

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

 
 
02Fstrim.zip Flash by recovery.!
 
This script will create a log at "/data/trim.log" there you can see the amount of bytes that was trimmed
 
 
You will see something like this...
post-1027947-0-54776400-1396474045_thumb
 
  • Disable FSTRIM.!
 
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 
 
To end, here a script with my SysCtl preferences like swappiness, min_free_kbytes, read_ahead_kb...
 
 
  • Disable My Sysctl-Preferences.
 
 
 
That's all! Greetings!
Edited by Victod
Link to comment
Share on other sites

Wouldn't be easier to use Trickster Mod and tick that zRam off...

 

Well, I prefer that these scripts do the work by me at disabling zRAM each time I install CyanogenMod 11 !!

 

That's ok if you prefer installing such app to make things that one SIMPLE script can make without consume memory.!! 

Link to comment
Share on other sites

  • 4 weeks later...
Guest Victod

Updater-Script fixed! [24/03/2014]

 

Heya, i tried this method on latest Slimkat but i dont see anyfile on system folder, how can i know if the swap file is created?

 

Please, download again, install it, and before install smth through recovery make sure that system is mounted...

 

Greetings!

Link to comment
Share on other sites

Guest farfix

I have a doubt here...

 

How I must flash these zip files?

I have to flash the "Zram disabler", restart, boot phone, restart again, flash the swap and restart?

 

Or can I flash both files in recovery and just restart?

 

Greetings!

Link to comment
Share on other sites

Guest Victod

I have a doubt here...

 

How I must flash these zip files?

I have to flash the "Zram disabler", restart, boot phone, restart again, flash the swap and restart?

 

Or can I flash both files in recovery and just restart?

 

Greetings!

 

Si, puedes instalar todos sin necesidad de reiniciar, el orden de instalación no importa...

 

y lo del zRam es solo para las ROMS de Kitkat...

 

 

English...
 
Yep! u can install all scripts without reboot, and installation order doesn't matter 
 
zRam script is only to Kitkat based ROMS
Edited by Victod
Link to comment
Share on other sites

Guest farfix

 

Si, puedes instalar todos sin necesidad de reiniciar, el orden de instalación no importa...

 

y lo del zRam es solo para las ROMS de Kitkat...

 

 

English...
 
Yep! u can install all scripts without reboot, and installation order doesn't matter 
 
zRam script is only to Kitkat based ROMS

 

 

Thanks! I thinked that I've done a mistake there flashing both zip at same time... I'm using Slimkat :)

 

(Spanish): ¡Gracias! Creí que me había equivocado al flashear los 2 zip al mismo tiempo... Uso Slimkat :)

Link to comment
Share on other sites

Guest Victod

Thanks! I thinked that I've done a mistake there flashing both zip at same time... I'm using Slimkat :)

 

(Spanish): ¡Gracias! Creí que me había equivocado al flashear los 2 zip al mismo tiempo... Uso Slimkat :)

 

De nada...

 

Y como dice la imagen de mi firma, usa el botón para dar las gracias...  ^_^

 

Saludos!

Link to comment
Share on other sites

Guest Victod

So you recommend the 128mb cache swap iover the 250mb system?

 

Yes, because unlike the system partition, partition cache is almost unused and almost always is empty

 

you can increase the value of the swap file but remember that cache partition isn't as large as system

 

/Cache    188mb

/System   1006mb

Link to comment
Share on other sites

Guest barnir

Well that size should be enough i guess, i installed now that version and yup now i can see the file on cache xd thank you mate for updating this 

Link to comment
Share on other sites

Guest SaurabhRCk

on slimkat, i disabled zram with performance control. so do i have to flash the zram disable script too, or just the swap script ??

Link to comment
Share on other sites

Guest Victod

on slimkat, i disabled zram with performance control. so do i have to flash the zram disable script too, or just the swap script ??

 

These scripts are independent, you can use it by separate... So, is not needed to use Swap script if you want to disable zRAM....

 
The intention of the scripts is disable zRAM before the first boot, to get a better performance...
Link to comment
Share on other sites

Guest Victod

And zram is activated on every kitkat roms?

 

Well, now with Ceastel kernel running on Slimkat and others  KK ROMS, I don't know exactly wich of these have zRAM by default...
 
But I sure that CM 11 have zRAM activated...
 
Edit:
 
Confirmed!... zRam still is by default on all KK Roms
Edited by Victod
Link to comment
Share on other sites

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.