[MOD][2013-08-10][V3.03]TURBO BOOST - Triple Swap Space in Cache, Data, System ...

hgmichna

Senior Member
Aug 28, 2010
982
400
63
Munich
michna.com
I've set a single 300 M swap file (in /cache), but it fills only to 120..140 M. Swappiness is set to 100. WTF?
The nicest explanation is that you don't need more. How much RAM does your phone have?

I would set the swappiness much lower for Android devices. Perhaps 10. Android differs from other Linux systems in that it tends to use more of the swap file than what is really desirable. Android keeps apps and their data in RAM when there is enough of it, and it does not "know" that there is a slow swap file, hence it tends to over-use it when you load many apps. Android was never designed for systems with a swap file.
 
  • Like
Reactions: Prasad98

siealex

Senior Member
Jul 22, 2008
2,535
497
163
Kharkov
The nicest explanation is that you don't need more. How much RAM does your phone have?
1 G, 744 M available for user, usually 200..220 M free on boot. The d-mn system throws out most apps instead of putting them into swap.
PS, must I switch off ZRAM in Trickster?
 

Sik-1

Senior Member
Oct 28, 2009
1,429
553
0
Brooklyn
it has been reported in the past that zram would be better turned off
In the past is right, but now android is built since kk to use zram and Google recommends it

Sent from my Barnes & Noble Nook Tablet using XDA Free mobile app

---------- Post added at 10:10 AM ---------- Previous post was at 10:08 AM ----------

You may be quite right, but there is also the possibility that a larger swap file makes everything slower, rather than faster. It is good to test and try.

The reason is that everything that is in the swap file can become slower, so the smaller the swap file, the better.

On the other hand, with a smaller swap file apps would get kicked out of RAM earlier, which may be undesirable, so the bigger the swap file, the better. But the apps that are actually running do not run faster because of the swap file.

That is why it may not be a good idea to make the swap file too big. But since it all depends on which apps the user needs, and particularly which apps the user wants to be active simultaneously, the optimal swap file size is different for each user and probably cannot be determined theoretically. Users have to test different swap file sizes to find out what works best for them.

My general advice is not to use very large swap files and instead find out through testing what is the smallest swap file that serves the purpose. Consider that loading an app from internal memory is essentially not slower than loading it from the swap file, because both live in the slow flash memory.

The only difference is that an app in the swap file may still be in the same state in which it was last used, for a while at least. This may or may not be advantageous in the case of a web browser that does not have to reload the last page, provided the user wants to see that last page again. But it may make little or no difference for many other apps.

(Now if only I could get a swap file installed and working on my Galaxy Nexus with CyanogenMod! It has only 1 GB RAM and would certainly benefit from a swap file. But that never worked.)
To get it to work on gnex, u must unzip the files and take them from there respected folders to put into init.d, u must have a kernel supporting zram also, and it def will work

With the correct perms set u should b good to go with a reboot

Sent from my Barnes & Noble Nook Tablet using XDA Free mobile app
 
  • Like
Reactions: rzr86

kassaaam

Senior Member
Apr 14, 2014
260
41
58
You may be quite right, but there is also the possibility that a larger swap file makes everything slower, rather than faster. It is good to test and try.

The reason is that everything that is in the swap file can become slower, so the smaller the swap file, the better.

On the other hand, with a smaller swap file apps would get kicked out of RAM earlier, which may be undesirable, so the bigger the swap file, the better. But the apps that are actually running do not run faster because of the swap file.

That is why it may not be a good idea to make the swap file too big. But since it all depends on which apps the user needs, and particularly which apps the user wants to be active simultaneously, the optimal swap file size is different for each user and probably cannot be determined theoretically. Users have to test different swap file sizes to find out what works best for them.

My general advice is not to use very large swap files and instead find out through testing what is the smallest swap file that serves the purpose. Consider that loading an app from internal memory is essentially not slower than loading it from the swap file, because both live in the slow flash memory.

The only difference is that an app in the swap file may still be in the same state in which it was last used, for a while at least. This may or may not be advantageous in the case of a web browser that does not have to reload the last page, provided the user wants to see that last page again. But it may make little or no difference for many other apps.

(Now if only I could get a swap file installed and working on my Galaxy Nexus with CyanogenMod! It has only 1 GB RAM and would certainly benefit from a swap file. But that never worked.)
Sorry but you're quite wrong. The higher the size of the swap files, the better the phone will run as it'll never move out of resources. Though it's not just the swap size that you must be concerned about, it depends on you. Personally I've 1gb ram on my HTC and I've created swap files of 800mb, but that used to make my phone lag because it never really killed the running background apps that I never really wanted to use.

So the solution is to have big swap files, put every non frequently used apps to be greenified and tweak your minfree settings (I keep it to aggressive, serves me well as I'm not big fan of multitasking apps running in the background when even of they are not running, they never take more than a second to start). And the phone never lags.
 

hgmichna

Senior Member
Aug 28, 2010
982
400
63
Munich
michna.com
Sorry but you're quite wrong. The higher the size of the swap files, the better the phone will run as it'll never move out of resources. Though it's not just the swap size that you must be concerned about, it depends on you. Personally I've 1gb ram on my HTC and I've created swap files of 800mb, but that used to make my phone lag because it never really killed the running background apps that I never really wanted to use.

So the solution is to have big swap files, put every non frequently used apps to be greenified and tweak your minfree settings (I keep it to aggressive, serves me well as I'm not big fan of multitasking apps running in the background when even of they are not running, they never take more than a second to start). And the phone never lags.
My experience came from phones with little RAM, less than 1 GB. Nowadays, with 1 GB or more, you are right that a large swap file can work just fine. Technically the question is whether the working set of app pages fits into real RAM. Since Linux is quite good at putting the needed stuff in real RAM and keeping the rest on the swap file, 1 GB RAM plus any size of swap file can work well.

But if you load several apps that all work simultaneously and actually need more than the available real RAM, you will see the phone slow down. My typical situation was a Samsung Galaxy Nexus (1 GB RAM) with Google Navitagion, a track recorder (Locus), a speed trap warner, and then calling up Hangouts to tell somebody you will be late. That invariably leads to Android kicking out one or more apps, because they simply do not fit.. I had no swap file, but if I had had one, the apps would have kept running, but the swapping would likely have slowed down the running processes. I could never try a swap file on that phone, because apparently the kernel does not support it, and I was not ready to fiddle with that.

I have never done any additional tweaking and do not understand it well. I guess it is not urgently needed to make the swap file work well. I would use a low swappiness setting though, to counteract Android's built-in tendency to use all RAM it can get hold of, and that includes the swap file.

I did not understand your minfree remarks. Does minfree refer to real RAM or virtual RAM (i.e. including the swap file)? Anyway it sounds as if minfree should not be set too small.
 
Last edited:

kassaaam

Senior Member
Apr 14, 2014
260
41
58
My experience came from phones with little RAM, less than 1 GB. Nowadays, with 1 GB or more, you are right that a large swap file can work just fine. Technically the question is whether the working set of app pages fits into real RAM. Since Linux is quite good at putting the needed stuff in real RAM and keeping the rest on the swap file, 1 GB RAM plus any size of swap file can work well.

But if you load several apps that all work simultaneously and actually need more than the available real RAM, you will see the phone slow down. My typical situation was a Samsung Galaxy Nexus (1 GB RAM) with Google Navitagion, a track recorder (Locus), a speed trap warner, and then calling up Hangouts to tell somebody you will be late. That invariably leads to Android kicking out one or more apps, because they simply do not fit.. I had no swap file, but if I had had one, the apps would have kept running, but the swapping would likely have slowed down the running processes. I could never try a swap file on that phone, because apparently the kernel does not support it, and I was not ready to fiddle with that.

I have never done any additional tweaking and do not understand it well. I guess it is not urgently needed to make the swap file work well. I would use a low swappiness setting though, to counteract Android's built-in tendency to use all RAM it can get hold of, and that includes the swap file.

I did not understand your minfree remarks. Does minfree refer to real RAM or virtual RAM (i.e. including the swap file)? Anyway it sounds as if minfree should not be set too small.
If you knew what minfree settings are, you wouldn't have written such a long reply. Anyway minfree is a file in your kernel that controls the amount of ram to be used before the system starts killing apps. By default minfree settings are moderate (with lesser values) so the system keeps letting apps stay in ram or swap or zram and only kills it when it just has out 50 60 mb of ram in most phones, might be much different on other phones.

So if you just play around with the minfree settings and make them more strict, you won't have apps that are not needed running in the background.
Easiest way to do it is to download from play store "Trickster mod" or "infamous performance", both have custom presets for minfree settings, from light to very aggressive. I personally set it to aggressive and when I need more battery life I set it to very aggressive so I never have battery eating apps running in the background. So even if I set swapiness to 100,the phone never really needs to use all of the swap space instead it only 300mb out of the 700mb fills up at the very most and after I'm done using those apps and turn screen off, the phone releases the unrequired processes again and swaps get almost emptied again.
 
Last edited:
  • Like
Reactions: Prasad98

Xemidra

Senior Member
Jul 2, 2014
468
258
0
@delta-roh

You can add LG G2 Mini and LG L90 to the supported devices list. It works great.

What about internal memory wear level due to constant writes ?
Won't my phone just stop working one day couse my internal memory would just get to the end-of-life ?
 

goldug

Member
Nov 3, 2012
12
0
0
I can't install this mod via clockworkmod recovery.
I wish I could do a screenshot, but I don't know how...
It doesn't recognize my device, it just says
Turbo Boost-v3.03
-_-_-_-
This is Universal Mod.
Chack That Your Device is correct :-

YOUR DEVICE: [blank]
Get Ready To Feel The HEAT!
-_-_-_-​
And at the bottom, it's the regular info except for DEVICE : ()

I have a Samsung Galaxy S2 that should be supported.

EDIT:
Never mind, I fixed it by updating my stone-aged kernel... I was running Jeboo Kernel 1.2a, and the latest is 2.3... I only have myself to blame :(
I know it's probably dumb in your opinion, being experts on this kind of thing and all, but it wouldn't be bad if you had a little "disclaimer" or something in the info that states that you should have the latest kernel before trying to install, even though that should be common practise :)

EDIT 2:
I got it installed, but when doing the free -m in terminal as su, swap is 0. My system doesn't have a /system/etc/init.d folder initially either, could that be the reason? I'm running on stock rom, but custom kernel.
 
Last edited:

rzr86

Senior Member
May 21, 2012
8,109
2,455
258
35
Nafpaktos
I can't install this mod via clockworkmod recovery.
I wish I could do a screenshot, but I don't know how...
It doesn't recognize my device, it just says

And at the bottom, it's the regular info except for DEVICE : ()

I have a Samsung Galaxy S2 that should be supported.

EDIT:
Never mind, I fixed it by updating my stone-aged kernel... I was running Jeboo Kernel 1.2a, and the latest is 2.3... I only have myself to blame :(
I know it's probably dumb in your opinion, being experts on this kind of thing and all, but it wouldn't be bad if you had a little "disclaimer" or something in the info that states that you should have the latest kernel before trying to install, even though that should be common practise :)

EDIT 2:
I got it installed, but when doing the free -m in terminal as su, swap is 0. My system doesn't have a /system/etc/init.d folder initially either, could that be the reason? I'm running on stock rom, but custom kernel.
your rom must have an init.d folder and stock rom doesn't support in first place
you can create it by yourself set permissions and reboot
then try flashing again the mod

also the important is the kernel must support swap
check in the kernel thread if it supports swap