• Announcements

    • Reminder - MoDaCo position on illegal content   07/30/15

      ILLEGAL CONTENT I'd like to just reaffirm MoDaCo's position regarding piracy and illegal content in the light of some recent questions / postings. Posts will be censored by myself or my moderation team if the contain or link to: Illegal / pirated / cracked software or sites that host such softwareNintendo emulators / ROMs or sites hosting them (in light of Nintendo's legal stance)CUSTOM ROMS You may discuss and post links to custom device ROMs on MoDaCo, provided the following rules are adhered to: ROMs must not contain any illegal 3rd party software (this includes trial versions included without permission)ROMs must give full credit to the original authorISSUES If you have any issues with this policy, please contact PaulOBrien directly via PM.
    • Reminder: Selling items on the forum directly is not allowed   07/30/15

      Please note that selling items on the forum directly is not allowed by the forum rules. There is a forum for eBay auctions whereby you can list the items on eBay and link to them there. This is the ONLY forum for this type of activity. You may also advertise links to the eBay forum in your signature. Please note that selling directly in contravention of these rules will result in a warning / suspension / ban.

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

79 posts in this topic

Posted (edited) · Report post

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
6

Share this post


Link to post
Share on other sites

Posted · Report post

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

0

Share this post


Link to post
Share on other sites

Posted · Report post

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

Share this post


Link to post
Share on other sites

Posted · Report post

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

0

Share this post


Link to post
Share on other sites

Posted · Report post

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

yes
0

Share this post


Link to post
Share on other sites

Posted · Report post

Yes

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

Share this post


Link to post
Share on other sites

Posted · Report post

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

Share this post


Link to post
Share on other sites

Posted · Report post

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

0

Share this post


Link to post
Share on other sites

Posted · Report post

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

 

Sure!

0

Share this post


Link to post
Share on other sites

Posted · Report post

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

Share this post


Link to post
Share on other sites

Posted · Report post

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

Share this post


Link to post
Share on other sites

Posted · Report post

New Method! - Recommended

 

Swap file at cache partition thanks to chiwahfj6

0

Share this post


Link to post
Share on other sites

Posted · Report post

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

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

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
1

Share this post


Link to post
Share on other sites

Posted · Report post

 

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

Share this post


Link to post
Share on other sites

Posted · Report post

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

Share this post


Link to post
Share on other sites

Posted · Report post

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

0

Share this post


Link to post
Share on other sites

Posted · Report post

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

Share this post


Link to post
Share on other sites

Posted · Report post

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

Share this post


Link to post
Share on other sites

Posted · Report post

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

Share this post


Link to post
Share on other sites

Posted · Report post

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

Share this post


Link to post
Share on other sites

Posted · Report post

And zram is activated on every kitkat roms?

0

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

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
0

Share this post


Link to post
Share on other sites

Posted · Report post

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

0

Share this post


Link to post
Share on other sites

Posted · Report post

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

hi..wat recovery do you use..
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

MoDaCo is part of the MoDaCo.network, © Paul O'Brien 2002-2015. MoDaCo uses IntelliTxt technology.