Jump to content


Photo

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


  • Please log in to reply
71 replies to this topic

#1
Victod

Victod

    Enthusiast

  • Members
  • PipPipPip
  • 267 posts
  • Gender:Male
  • Location:Venezuela
  • Interests:Future!
  • Devices:Samsung Galaxy SIII mini
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/...h.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...
Attached File  Screenshot_2014-04-02-16-42-44.png   21.85KB   110 downloads
 
  • 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, 04 May 2014 - 05:25 PM.

  • 6

#2
mockingbird

mockingbird

    Enthusiast

  • Members
  • PipPipPip
  • 167 posts
  • Gender:Male
  • Location:Bucharest, Romania
  • Devices:Huawei Y300
Wouldn't be easier to use Trickster Mod and tick that zRam off...

  • 0

#3
Victod

Victod

    Enthusiast

  • Members
  • PipPipPip
  • 267 posts
  • Gender:Male
  • Location:Venezuela
  • Interests:Future!
  • Devices:Samsung Galaxy SIII mini

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.!! 


  • 0

#4
SH3H1

SH3H1

    Hardcore

  • Members
  • PipPipPipPipPipPip
  • 1,217 posts
  • Gender:Male
  • Devices:Huawei Ascend Y300-0100
It's safe to use swap on system partition? :wacko:

  • 0

#5
Gliwusss

Gliwusss

    Enthusiast

  • Members
  • PipPipPip
  • 263 posts
  • Gender:Male
  • Location:Poland
  • Devices:Huawei ascend y300

It's safe to use swap on system partition? :wacko:

yes

  • 0

Sorry for sometimes 'poor' english ;)

Device: Huawei Ascend Y300
ROM: MIUI v5 by Tirimosqui
Kernel: Cexstel 0.60 407mb RAM
Recovery: TWRP 2.7.0.2

#6
SH3H1

SH3H1

    Hardcore

  • Members
  • PipPipPipPipPipPip
  • 1,217 posts
  • Gender:Male
  • Devices:Huawei Ascend Y300-0100

Yes

Won't it affect as the same as an sd card in terms of life of it? :huh:

  • 0

#7
Gliwusss

Gliwusss

    Enthusiast

  • Members
  • PipPipPip
  • 263 posts
  • Gender:Male
  • Location:Poland
  • Devices:Huawei ascend y300

Won't it affect as the same as an sd card in terms of life of it? :huh:


Nope, because system partition is default always in use :)

  • 0

Sorry for sometimes 'poor' english ;)

Device: Huawei Ascend Y300
ROM: MIUI v5 by Tirimosqui
Kernel: Cexstel 0.60 407mb RAM
Recovery: TWRP 2.7.0.2

#8
SH3H1

SH3H1

    Hardcore

  • Members
  • PipPipPipPipPipPip
  • 1,217 posts
  • Gender:Male
  • Devices:Huawei Ascend Y300-0100
The swap script can be used on stock? :unsure:

  • 0

#9
Victod

Victod

    Enthusiast

  • Members
  • PipPipPip
  • 267 posts
  • Gender:Male
  • Location:Venezuela
  • Interests:Future!
  • Devices:Samsung Galaxy SIII mini

The swap script can be used on stock? :unsure:

 

Sure!


  • 0

#10
barnir

barnir

    Regular

  • Members
  • PipPip
  • 117 posts
  • Gender:Male
  • Location:Braga-Portugal
  • Devices:Huawei Ascend Y300

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?


  • 0

#11
Victod

Victod

    Enthusiast

  • Members
  • PipPipPip
  • 267 posts
  • Gender:Male
  • Location:Venezuela
  • Interests:Future!
  • Devices:Samsung Galaxy SIII mini

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!


  • 0

#12
Victod

Victod

    Enthusiast

  • Members
  • PipPipPip
  • 267 posts
  • Gender:Male
  • Location:Venezuela
  • Interests:Future!
  • Devices:Samsung Galaxy SIII mini

New Method! - Recommended

 

Swap file at cache partition thanks to chiwahfj6


  • 0

#13
farfix

farfix

    Regular

  • Members
  • PipPip
  • 55 posts
  • Gender:Male
  • Devices:Huawei Ascend Y300-0151
  • Twitter:@el_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!


  • 0

Sorry for my bad english... I'm chilean (I speak Spanish) :P


#14
Victod

Victod

    Enthusiast

  • Members
  • PipPipPip
  • 267 posts
  • Gender:Male
  • Location:Venezuela
  • Interests:Future!
  • Devices:Samsung Galaxy SIII mini

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, 24 March 2014 - 07:32 PM.

  • 1

#15
farfix

farfix

    Regular

  • Members
  • PipPip
  • 55 posts
  • Gender:Male
  • Devices:Huawei Ascend Y300-0151
  • Twitter:@el_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 :)


  • 0

Sorry for my bad english... I'm chilean (I speak Spanish) :P


#16
Victod

Victod

    Enthusiast

  • Members
  • PipPipPip
  • 267 posts
  • Gender:Male
  • Location:Venezuela
  • Interests:Future!
  • Devices:Samsung Galaxy SIII mini

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!


  • 1

#17
barnir

barnir

    Regular

  • Members
  • PipPip
  • 117 posts
  • Gender:Male
  • Location:Braga-Portugal
  • Devices:Huawei Ascend Y300

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


  • 0

#18
Victod

Victod

    Enthusiast

  • Members
  • PipPipPip
  • 267 posts
  • Gender:Male
  • Location:Venezuela
  • Interests:Future!
  • Devices:Samsung Galaxy SIII mini

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


  • 0

#19
barnir

barnir

    Regular

  • Members
  • PipPip
  • 117 posts
  • Gender:Male
  • Location:Braga-Portugal
  • Devices:Huawei Ascend Y300

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 


  • 0

#20
SaurabhRCk

SaurabhRCk

    Addict

  • Members
  • PipPipPipPipPip
  • 647 posts
  • Gender:Male
  • Location:India
  • Devices:Huawei Ascend Y300
  • Twitter:@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 ??


  • 0

Device :     Huawei Ascend Y300                                                                  Device:        Asus Zenfone 5

ROM:         Gamer ROM_R1                                                                           ROM:           ZenUI (Stock 4.3) (Rooted)

Kernel:      Synopsis kernel                                                                          Kernel:         Stock

Recovery:  TWRP 2.7.1.0                                                                              Recovery:    Stock





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users