Swap on Cyanogen 5.0.7 test1 - Thoughts! - G1 Android Development

Hey,
So Ive been playing with CM-5.0.7-DS test1, like everyone im sure , however I am noticing some major slowdown in the Launcher, many apps, and especially in 3g gallery without some memory assistance such as Swap\CC for the "low-memory" devices like the G1\Dream.
I enabled a 96mb swap partition, swappiness 60 using a userinit.sh script (see attached), and it really helped speed things along.
Wanted to know everyone else's experience using swap on this crazy new upgrade to our 2-yr old device

Good call. You can also just install "Swapper" from market, and go to advanced preferences, enable partition, good to go.
I am using a 96mb swap partition, and am overclocked to 596 mhz with the replacement kernel. Everything is working brilliantly for me, very stable.
Android 2.1, 600mhz Android device, ample RAM via swap, 16gb card, new slim extended battery - I am once again a happy G1 owner!

kristoff123 said:
Good call. You can also just install "Swapper" from market, and go to advanced preferences, enable partition, good to go.
I am using a 96mb swap partition, and am overclocked to 596 mhz with the replacement kernel. Everything is working brilliantly for me, very stable.
Android 2.1, 600mhz Android device, ample RAM via swap, 16gb card, new slim extended battery - I am once again a happy G1 owner!
Click to expand...
Click to collapse
:O howd u overclock to 596mhz?!

chim4ira312 said:
:O howd u overclock to 596mhz?!
Click to expand...
Click to collapse
The overclock thread that's been sitting on the top of this forum for the last week :0
the kernel I used is on page 38 or 39...anything over 600 eventually crashes for me, but 596 works very well. Flash video even plays fine with Skyfire - so many new goodies for my beloved G1!
-Although I am sure cyanogen will include that kernel or a better one with the next release, but leave it to the user to overclock using setcpu or whatever. Just leave it at 528 default via userinit.sh, so people can choose to what degree they want to melt their G1's, lol.

kristoff123 said:
Good call. You can also just install "Swapper" from market, and go to advanced preferences, enable partition, good to go.
I am using a 96mb swap partition, and am overclocked to 596 mhz with the replacement kernel. Everything is working brilliantly for me, very stable.
Android 2.1, 600mhz Android device, ample RAM via swap, 16gb card, new slim extended battery - I am once again a happy G1 owner!
Click to expand...
Click to collapse
hello
link please

lefeudedieu said:
hello
link please
Click to expand...
Click to collapse
Here, searched my ass off to find it...your welcome
http://forum.xda-developers.com/showpost.php?p=6352322&postcount=402

ok, thank
but i put the image boot by fastboot and G1 reboot and reboot ?

In my personal experiences with swap..... I'm not exactly sure what it was supposed to do after I applied it.
I do know what it does though...
As stated in previous forums,
The longevity og my card is very important to me
And finally, Cyanogen advises against swap.
if you would like to learn his thoughts, read his wiki.
And op, you crack me up. +10!
Sent from my HTC Dream using the XDA mobile application powered by Tapatalk

lefeudedieu said:
ok, thank
but i put the image boot by fastboot and G1 reboot and reboot ?
Click to expand...
Click to collapse
i think its not a image that can be flashed. it should be paste to /sd-ext document.

u need to extract the userinit.sh script and put it in /sd-ext

zimphishmonger said:
u need to extract the userinit.sh script and put it in /sd-ext
Click to expand...
Click to collapse
and thats it??

zimphishmonger said:
u need to extract the userinit.sh script and put it in /sd-ext
Click to expand...
Click to collapse
This conversation is confusing. 2 people talking about swap and 2 trying to overclock. Use the zip file from this thread, unzip it, open it with gedit or notepad++, add the stuff in the link from @zimphishmonger talking about overclocking. Follow the stepsw in that post. If you fastbooted the boot.img and it just boot loops, you may have trouble. You may need to reflash cm5.0.7. Or reinstall the Nandroid backup you made before you flashed it.
Also if history tells us anything, Cy will never include any over clock hack. He is pretty conservitive along those lines.

dangambino said:
and thats it??
Click to expand...
Click to collapse
Not exactly
do
adb shell chmod 755 /sd-ext/userinit.sh
to give it permissions.
My userinit.sh looks a little different so I can't say for sure it is correct.
...You mileage may vary.

thanks. running command now
seems to of took!

Swap is not a good feature to use, and I'll explain why:
When you enable swap, your end result is that you have a lot more "memory" available for programs to run in. Because of the memory management scheme used by android (kill background processes on low memory), it ends up that you will be RUNNING MORE PROCESSES. And this is a bad thing because (1) it means that your CPU will be more loaded (multitasking/background processes), and (2) it means that it will end up doing a lot of swapping (sdcard is SLOW) in order to continue providing all the "memory" allocated to each of those running programs.
The end result is that your phone will become VERY SLOW.
The ONLY legitimate use for swap is when you are running a process that is SO LARGE that it can't physically fit in the RAM available on the device *even when* all killable processes are already dead. And on Android, I have yet to encounter such a program.
DON'T USE SWAP! It will accomplish precisely TWO things;
(1) it will make your phone SLOW.
(2) it will kill your SDCARD.

lbcoder said:
DON'T USE SWAP! It will accomplish precisely TWO things;
(1) it will make your phone SLOW.
(2) it will kill your SDCARD.
Click to expand...
Click to collapse
(1) I disagree, it's the opposite ;-)
(2) agreed, but it probably will last enough till my next phone...

Most class 6 cards feature wear levelling from which from what I understand means I'll have upgraded my phone way before it ever dies.
For me using CM without swap has been impossible for quite a while now, gmail sync just doesn't work properly without the extra memory to fall back on. As for it slowing the phone down I've never noticed anything ever being slower with swap although I do have a class 6 card.

deimdos said:
(1) I disagree, it's the opposite ;-)
(2) agreed, but it probably will last enough till my next phone...
Click to expand...
Click to collapse
+1 I disagree as well.
If anything it helps the phone operate normally. Especially with the G1 it has a tendency to push GTalk out of the memory. That means it stops pushing email notifications to your phone, which is really annoying. Even eBuddy has a hard time staying in the memory if you minimize it. The G1 one really benefits from having the swap. And really, are SD cards that expensive? I've had swap on for 8 months and my SD card is fine. I personally use 64MB on my G1 and 30 swappiness, anymore is excessive.
Really you only want enough memory that it holds all the essential apps in place. Autokiller helps too if set at Moderate. So far CM5 though, the battery life is phenomenal compared to the old 4.2.15 (especially after the battery wipe stats fix, if you're having battery drain issues).
If you're using this on the Magic, then I have an issue with that, since it isn't even needed. Unless you have like over 300MB worth of apps and cache. Then maybe you'll need an ext partition. But that's a separate issue.

lbcoder said:
Swap is not a good feature to use, and I'll explain why:
When you enable swap, your end result is that you have a lot more "memory" available for programs to run in. Because of the memory management scheme used by android (kill background processes on low memory), it ends up that you will be RUNNING MORE PROCESSES. And this is a bad thing because (1) it means that your CPU will be more loaded (multitasking/background processes), and (2) it means that it will end up doing a lot of swapping (sdcard is SLOW) in order to continue providing all the "memory" allocated to each of those running programs.
The end result is that your phone will become VERY SLOW.
The ONLY legitimate use for swap is when you are running a process that is SO LARGE that it can't physically fit in the RAM available on the device *even when* all killable processes are already dead. And on Android, I have yet to encounter such a program.
DON'T USE SWAP! It will accomplish precisely TWO things;
(1) it will make your phone SLOW.
(2) it will kill your SDCARD.
Click to expand...
Click to collapse
Check out autokiller in the market. It limits the running processes so that swap actually works.

For those uncomfortable with making a userinit script, as I said before, Swapper does the same thing, it's free, and it's not a program that runs in memory. With the benefit being that you can experiment with swappiness and other settings on the fly. Just go to "Advanced" and select your partition - it's the right location by default.

Related

compcache module?

Anyone have a working compcache module for 1.5 builds? The previous JF builds used to have it, but I don't see one for 1.5.
Thanks.
I just tried compcache. Epic fail. I'm not sure if it's just broken horribly on ARM or what, but soon as I do "swapon /dev/ramzswap0", everything starts crashing. No kernel panics, just apps dying. I tried with and without a disk-based swap as a backing store (I have 3 partitions on my SD card).
I tried using the loop method earlier to create a swap on hero on my sdcard. it was successful but it's still painfully slow paging, unfortunately.
afflaq said:
I tried using the loop method earlier to create a swap on hero on my sdcard. it was successful but it's still painfully slow paging, unfortunately.
Click to expand...
Click to collapse
I have swap on actual SD card partition right now, and it's actually pretty snappy. Tons of **** running
cyanogen said:
I have swap on actual SD card partition right now, and it's actually pretty snappy. Tons of **** running
Click to expand...
Click to collapse
ugh mine bogged down. are you overclocking? It seems like I notice a *LOT* of problems when things start dipping into the swap. Ultimately I'll probably be back on one of your builds tomorrow..just get the goddamned lockscreen from 6.0r1 or help me port the framework over so i can have it on my personal build >=)
I tried it few days ago, with the same result. BTW, file-backed swap should be just as fast as a swap partition.
Hey guys, could you post some details about what you are doing so that we can get an idea of what works and what doesn't?
* What build are you on?
* Where did you get the compcache module? Did you compile it? If not, what kernel was it compiled for?
* What version of compcache did you use?
* What commands (options) did you use to install the module?
* What size device did you use?
* Did you use a file backing store?
* Did you mess with the swapiness setting? If so, what did you set it to?
I run the Dude's 1.2a build. I compiled compcache 5.3 against the android-msm-2.6.27 kernel using the prebuilt gcc 4.3. I tried many combinations of the settings, but it's always the same, processes get bus errors or segfaults... The modules I used are attached.
I can't wait until we figure this out, I think any performance boost or memory increase is definately needed with newer features and roms being released weekly
So how do we put a usable pagefile swap partition on Hero? I've been looking all day how to do it, but I'm not finding much.
What did you use to do this? Would love to set it up myself.
cyanogen said:
I have swap on actual SD card partition right now, and it's actually pretty snappy. Tons of **** running
Click to expand...
Click to collapse
http://www.cyrket.com/package/lv.n3o.swapper
I'd rather use squashfs with unionfs to compress /bin /and lib to save space and optimize speed, then use more device memory to create a swapfile instead of using an sd which would be slower. Although someone needs to set up a build environment and build a working compcache module and use that with my ideas above, once done android should run how it should have since october
Defcon
defconoi said:
I'd rather use squashfs with unionfs to compress /bin /and lib to save space and optimize speed, then use more device memory to create a swapfile instead of using an sd which would be slower. Although someone needs to set up a build environment and build a working compcache module and use that with my ideas above, once done android should run how it should have since october
Defcon
Click to expand...
Click to collapse
I nominate you.
But I have my app2sd and I have a bit of free space left on the internal. How much space would a swap file need? And also, what would be faster, the dalvik cache, or a swap file on internal?
From my understanding swapper doesn't work on 1.5.
dixxa said:
http://www.cyrket.com/package/lv.n3o.swapper
Click to expand...
Click to collapse
bad understanding since it works and I'm using it
Sure it runs and installs fine but after looking at it for an hour it never actually used the swap. It always stays at 0 bytes used.
dixxa said:
bad understanding since it works and I'm using it
Click to expand...
Click to collapse
currently using cyanogen rom and I'm sure it use it !
40Mo used on 75 available...
dixxa said:
currently using cyanogen rom and I'm sure it use it !
40Mo used on 75 available...
Click to expand...
Click to collapse
Let us know if you do not experience too many force closures eventually. I do whenever I use swap with JF1.5. I keep trying it every now and then just to eventually be disappointed.
defconoi said:
I'd rather use squashfs with unionfs to compress /bin /and lib to save space and optimize speed, then use more device memory to create a swapfile instead of using an sd which would be slower. Although someone needs to set up a build environment and build a working compcache module and use that with my ideas above, once done android should run how it should have since october
Defcon
Click to expand...
Click to collapse
Could you please explain what you are suggesting again, I can't understand it. For starters, there is no /bin on android, which lib are you referring to? And what kind of space are you trying to save by doing this (which partition? RAM?)? How would this optimize speed?
How does unionfs come into play in your scenario?
If you use the device memory (I suppose you mean flash, not RAM) for swap you will be wearing out your internal flash fairly quickly which, unlike an sdcard, cannot be replaced easily.
Compcache cannot use a file as backing store yet, only partitions.
If you have a great idea which I do not understand, please accept my apologies, but what you wrote sounds like you just chained together a bunch of buzzwords without understanding them. If you have a potentially viable idea, please enlighten us so that we can implement it.

[Idea]add memory to myTouch

Originally, a2sd was developed to allow installation of many apps on G1 as G1 has limited memory. The MT3G has more internal memory so it does not need a2sd.
My question is if we can enable a2sd on a MT3G and than use the additional memory for the system. This can improve performance so much ....
Is this possible? I'm a dev, but not on this kind of platform . I know shell scripting, Unix, C so I can help if needed, but don't know how to approach this thing.
Thx.
mr.tenuki said:
Originally, a2sd was developed to allow installation of many apps on G1 as G1 has limited memory. The MT3G has more internal memory so it does not need a2sd.
My question is if we can enable a2sd on a MT3G and than use the additional memory for the system. This can improve performance so much ....
Is this possible? I'm a dev, but not on this kind of platform . I know shell scripting, Unix, C so I can help if needed, but don't know how to approach this thing.
Thx.
Click to expand...
Click to collapse
It depends. Now if you have a 32a board, this is pointless. Unless you have 300+apps installed it will not hurt performance.
I sugest App killer to kill off unused apps that never shut down, it helps so much/
Me really dont need Apsd for mytouch, especially the new 32a boards. Running from the sd card slows everythign down. To improve your performance..
1. Get CPU overclosk from market, set lowest to 386, high to 528 screen on, screen off 256/256.
2. Download swapper, set to size of yoru swap partition etc...
3. Get any free app killer ( ifully suggest Anvanced task killer) and every hour or so, go in and ignore what u use all the time, and kill everything else.
Also, get Cachemate from market or Clean up. this clears out all the garbage.
Doing this, on a good day, my battery lasts 17 hours with data going. and My Live wallpapers never lag
Hi,
Thanks - I already have all that set up. I was thinking on a MOD that will allow improvement of performance in a different way.
My Idea is to actually use the memory that becomes available under /data as we move the app to SD to be used by /system partition. Maybe we can also do a "reverse RAM hack" and increase the 3D RAM.
Again, as I'm not very familiar with the Linux system I don't know how exactly this should be done, or if it can be done at all.
Thanks for the reply though
storage memory in the phone is different then addressable ram.. therefore what your saying is not possible...if you really want something like this set up a swap partition on your sd card.
also task killers are not needed for android... its been well documented here and on other forums as android handles processes much differently than your standard windows box (so no need to have the mindset that background apps are slowing down your system). android itself does an excellent job of managing memory and kills tasks itself when more mem is needed. i used to run ATK myself, and found after removing it my phone actually ran better than killing processes all the time.
your likely just having a placebo affect if you think it speeds up your phone.. however killing process can increase battery life.. albeit only slightly...try it yourself and you will see what im talking about..
regarding task killers, just google it and you will see what im saying...
edit: most roms have cpu scaling in them, if you want an app i find set cpu to be the best, followed by overclock widget...
edit2: forgot to mention autostarts . a great program to edit which programs start up upon boot .. if your still worried about having things running in the background...
I was trying to get a swapfile on /Data (being a lot faster than sdcard, probably), but It didn't work :/

Kernel conflicting with AutoKiller app?

I just flash a OC kernel to my sprint* hero. I am running Fresh 2.4 with the 710 OC kernel (chose 710 thinking it will be more stable, yes/no?). Before flashing this Kernel I was using AutoKiller on Optimum mode to help keep the phone in line. I am wondering now if AutoKiller is conflicting with my OC'ing of the phone. Should I uninstall the AutoKiller, or maybe change the mode to Chuck Norris? I just dont want the phone to act like a PC does with 2 anti-virus programs installed on it!
thanks
IN my opinion no one should have an autokiller app on there phone. The Android OS kills apps when it needs the space for another app. If it helps i use a program called FAST REBOOT that works pretty good. when the phone starts feeling sluggish i just fast reboot and it makes it run better.
on a side note....this is a Question and it belongs in the Q&A section not here in development.
Thanks for the input. I will try without it and check out Fast Boot!
Mods Please move thread to Q and A
t12icky0 said:
IN my opinion no one should have an autokiller app on there phone. The Android OS kills apps when it needs the space for another app. If it helps i use a program called FAST REBOOT that works pretty good. when the phone starts feeling sluggish i just fast reboot and it makes it run better.
on a side note....this is a Question and it belongs in the Q&A section not here in development.
Click to expand...
Click to collapse
The fact you called it "an autokiller app", as well as your explanation why you shouldn't have it, shows you really have no clue what AutoKiller is.
What you are referring to is a TASK killer, and I agree ... no one needs it because the internal memory manager does the same function much more fluidly and does not require an extra running process, hence is lighter on the system. AutoKiller (the actual app) simply allows you to customize the settings for that internal memory manager. This is pretty much necessary because the settings for this manager haven't changed at all since Android first debuted, and these settings basically leave you with around 25 MB remaining. That may be awesome for a G1, but for more powerful devices like our hero it is SLUGGISH, so upping the internal settings just performs the exact same function with more effective results for our devices.
To answer the original question, the only conflict that could exist is if the kernel itself has its own memory manager embedded. I've been on CM6 for some time, so I'm not sure if the kernel you chose has such a memory manager. If it does, however, it most likely has the same upgraded settings as you would hope to attain with AutoKiller. In this case, there is no need.
Hope this answers your question more completely.
tquetano said:
The fact you called it "an autokiller app", as well as your explanation why you shouldn't have it, shows you really have no clue what AutoKiller is.
What you are referring to is a TASK killer, and I agree ... no one needs it because the internal memory manager does the same function much more fluidly and does not require an extra running process, hence is lighter on the system. AutoKiller (the actual app) simply allows you to customize the settings for that internal memory manager. This is pretty much necessary because the settings for this manager haven't changed at all since Android first debuted, and these settings basically leave you with around 25 MB remaining. That may be awesome for a G1, but for more powerful devices like our hero it is SLUGGISH, so upping the internal settings just performs the exact same function with more effective results for our devices.
To answer the original question, the only conflict that could exist is if the kernel itself has its own memory manager embedded. I've been on CM6 for some time, so I'm not sure if the kernel you chose has such a memory manager. If it does, however, it most likely has the same upgraded settings as you would hope to attain with AutoKiller. In this case, there is no need.
Hope this answers your question more completely.
Click to expand...
Click to collapse
It does, Thanks! I do have the Advanced Task Killer (everyone has or had at one point! lol) and will lose that app right away! With the advanced task killer I still drop in free memory, so it doesnt seem to be doing anything, or what I want it to do. Just kills a few apps, like you said android will do that on it own. The Kernel I have is Darchstars Kernel vUV2 710mhz for roms using 2.1 RUU. It states in big letters "BUGS IN zIMAGE FREEMEMKILLER" just wondering if the AutoKiller has the same issues as the FreeMeKiller? My memory will drop to 50 right now, that is with autokiller set to optimum, I want to raise it higher to keep more free memory, didnt want a conflict though.
cordell12 said:
It does, Thanks! I do have the Advanced Task Killer (everyone has or had at one point! lol) and will lose that app right away! With the advanced task killer I still drop in free memory, so it doesnt seem to be doing anything, or what I want it to do. Just kills a few apps, like you said android will do that on it own. The Kernel I have is Darchstars Kernel vUV2 710mhz for roms using 2.1 RUU. It states in big letters "BUGS IN zIMAGE FREEMEMKILLER" just wondering if the AutoKiller has the same issues as the FreeMeKiller? My memory will drop to 50 right now, that is with autokiller set to optimum, I want to raise it higher to keep more free memory, didnt want a conflict though.
Click to expand...
Click to collapse
If you are using a kernel made for 2.1, you should not be using it. CyanogenMod 6 is built on Android 2.2, so either use the stock kernel or UncappedKernel from Decad3nce. Second, having the processor clocked at 710Mhz will NOT make the phone more stable. If anything, it will become unstable because of the added heat and power needed to run the processor. A good overclock that I've found that should be stable on our phones is from 650-690Mhz. Although I've been running my phone at 590Mhz, and I haven't found any real-life difference in the speeds. Like said above, tweaking the minfree (the Android internal task killer) is perfectly fine. What you do NOT want to do is use a program like Task Killer or Advanced Task Killer, since those will both end unnecessary processes, which will then have to be restarted, in effect using more battery and CPU cycles. So the best way, if you want, is to tweak the minfree settings with a program like Autokiller.
mrinehart93 said:
If you are using a kernel made for 2.1, you should not be using it. CyanogenMod 6 is built on Android 2.2, so either use the stock kernel or UncappedKernel from Decad3nce. Second, having the processor clocked at 710Mhz will NOT make the phone more stable. If anything, it will become unstable because of the added heat and power needed to run the processor. A good overclock that I've found that should be stable on our phones is from 650-690Mhz. Although I've been running my phone at 590Mhz, and I haven't found any real-life difference in the speeds. Like said above, tweaking the minfree (the Android internal task killer) is perfectly fine. What you do NOT want to do is use a program like Task Killer or Advanced Task Killer, since those will both end unnecessary processes, which will then have to be restarted, in effect using more battery and CPU cycles. So the best way, if you want, is to tweak the minfree settings with a program like Autokiller.
Click to expand...
Click to collapse
I am using Fresh 2.4, not CyanogenMod 6. I think there is a lower OC than what I am using. I will have to check, I knew the 768 would be way to much so I chose the 710 (middle option), so yes there is a lower OC. I have uninstalled the advanced task killer, it seems to be doing fine with AutoKiller set to "Strict" that keeps my memory around 60, before it would drop to low 40s I am new to all this so trial and error on my part will help me find a happy medium. I am getting a lot of help here and at android forums, thats how I found this site My wife has the same phone and is jealous of my speed but is scared to let me flash a rom to hers. She watched me stressing out when I was getting stuck in boot loops! I kept trying to partition my SD card to get apps2sd working, every time I after my partition I would get stuck in a dang boot loop. Seems after I partition the SD I need to re-flash my rom in order to get Fresh to see the partition. Or I think thats the issue? As of now I dont have a class 6 SD card, just found out I will need one so I am gonna wait for the apps2sd thing.
thanks
691 is the lowest Kernel, so either 691, 710, or 768. Will the 691 make that much of a difference than the 710? Stock is 528 I think
tquetano said:
The fact you called it "an autokiller app", as well as your explanation why you shouldn't have it, shows you really have no clue what AutoKiller is.
What you are referring to is a TASK killer, and I agree ... no one needs it because the internal memory manager does the same function much more fluidly and does not require an extra running process, hence is lighter on the system. AutoKiller (the actual app) simply allows you to customize the settings for that internal memory manager. This is pretty much necessary because the settings for this manager haven't changed at all since Android first debuted, and these settings basically leave you with around 25 MB remaining. That may be awesome for a G1, but for more powerful devices like our hero it is SLUGGISH, so upping the internal settings just performs the exact same function with more effective results for our devices.
To answer the original question, the only conflict that could exist is if the kernel itself has its own memory manager embedded. I've been on CM6 for some time, so I'm not sure if the kernel you chose has such a memory manager. If it does, however, it most likely has the same upgraded settings as you would hope to attain with AutoKiller. In this case, there is no need.
Hope this answers your question more completely.
Click to expand...
Click to collapse
yea my bad..lol. i had a brain fart. thought it said task killer.
cordell12 said:
I am using Fresh 2.4, not CyanogenMod 6. I think there is a lower OC than what I am using. I will have to check, I knew the 768 would be way to much so I chose the 710 (middle option), so yes there is a lower OC. I have uninstalled the advanced task killer, it seems to be doing fine with AutoKiller set to "Strict" that keeps my memory around 60, before it would drop to low 40s I am new to all this so trial and error on my part will help me find a happy medium. I am getting a lot of help here and at android forums, thats how I found this site My wife has the same phone and is jealous of my speed but is scared to let me flash a rom to hers. She watched me stressing out when I was getting stuck in boot loops! I kept trying to partition my SD card to get apps2sd working, every time I after my partition I would get stuck in a dang boot loop. Seems after I partition the SD I need to re-flash my rom in order to get Fresh to see the partition. Or I think thats the issue? As of now I dont have a class 6 SD card, just found out I will need one so I am gonna wait for the apps2sd thing.
thanks
Click to expand...
Click to collapse
Like I said, I'm on CM6, but I run Aggressive with no problem. In reality, either Strict or Aggressive works well, but if you up it above that then it basically starts interpreting every application running in the background as an extraneous app and kills it aggressively whether you're using it or not. Also, because the system is constantly trying to increase the memory thats available to meet the thresholds, it is constantly working to close programs that aren't there, and then it becomes a bog on the system again. Long story short, stick to Strict and you should find that perfect balance and remain smooth.

[Q] Making Swapfile on Gtab 7+?

hi guys,..
i want to ask is there any way i can make swapfile on gtab 7+ running hc 3.2? or there is no posibility to make swapfile on honeycomb? i've tried to make the swapfile using dd command from terjinal, but somehow im stucked on setting permission for the file, the file i've created always have special permission that i can't change to rw-r-r, it always stayed rw-rSw-r, im a newbie on linux things, and willing to learn.
any help really appreciate.
thanks.
Okay, you say that you're a newbie to linux. That's fair and reasonable. I'm going to try and teach you some things by way of asking questions. They might sound like I'm attacking you, but I'm not...
Do you know you are trying to create a swap file? What do you hope to gain by doing so?
Is this one of those mythical magical things that someone claims will make the tablet run 50395920 times faster, allow it to brew coffee, and make your car get better fuel mileage?
...and some answers...
Within the android environment, a swap file is a BAD THING. The entire system is designed to drop stuff out of memory if/when it needs more memory, and the overhead of a swapfile will cause more harm than good.
Take care
Gary
garyd9 said:
Within the android environment, a swap file is a BAD THING. The entire system is designed to drop stuff out of memory if/when it needs more memory, and the overhead of a swapfile will cause more harm than good.
Click to expand...
Click to collapse
It's not that dramatic. Most of "the overhead of a swapfile" is overhead you're already committing to by utilizing a VMM (Virtual Memory Manager). The Dalvik VM doesn't do a whole lot of its own memory management so implementing a swapfile at the OS level, which is what the OP is looking to do, wouldn't have a huge impact on performance.
The only time where you'd have any real overhead of maintaining a swapfile is when memory is full and the OS pages out memory to disk. But remember that the alternative is to close down the process and run some garbage collection. Both are intensive actions - swapfile is I/O intensive while GC is CPU and memory intensive - so you're really trading one source of overhead for another.
To answer the OP's question, it sounds like you haven't rooted the tab. You would need to be root in order to change the perms as you described. If you are rooted, make sure you're using the right command to set permissions - I haven't tried this specifically on Android but from my *nix experience, the command you want is chmod 644 <path to file>
---------- Post added at 09:24 PM ---------- Previous post was at 08:39 PM ----------
Almost forgot, what kernel are you using?
im using stock kernel 2.6.36, kk6 rooted. i've tried to chmod the swapfile, but still cant change the permission, i usually use root explorer to change the permission, but now it doesn't take effect. the file permission r8 now is rw-rwSr--, the "S" thing is making the swap cant be aplied (i guess).
back there when i use optimus (gingerbread), swapfile is default from stock rom. is it have something to do with honeycomb?
thanks for your reply.
garyd9 said:
Okay, you say that you're a newbie to linux. That's fair and reasonable. I'm going to try and teach you some things by way of asking questions. They might sound like I'm attacking you, but I'm not...
Do you know you are trying to create a swap file? What do you hope to gain by doing so?
Is this one of those mythical magical things that someone claims will make the tablet run 50395920 times faster, allow it to brew coffee, and make your car get better fuel mileage?
...and some answers...
Within the android environment, a swap file is a BAD THING. The entire system is designed to drop stuff out of memory if/when it needs more memory, and the overhead of a swapfile will cause more harm than good.
Take care
Gary
Click to expand...
Click to collapse
thanks m8 for your lighten up of linux, i really appreciate it. just from my experient when im using optimus (gingerbread) i never felt lack of memory when using multitasking (it only has 512mb ram). but now when i using gtab (with 1gb ram or 778mb?) first it fast on multitasking but about 10 minute later it getting slower, when i check with task manager, it only has 80mb left??
is it me or is it gingerbread have better ram management than honeycomb, and so if it is, im trying to make swapfile in hope that its getting better. i use v6 supercharger, kill all proccess when it turn to standby by automatic, overclocking to 1,6ghz, but still i can make the ram more efficient when running on multitasking.
hope you understand for what im going to achieve.
thanks.
h2g2 said:
It's not that dramatic.
Click to expand...
Click to collapse
Are you suggesting that using an OS-level "generic" swapfile on flash memory is better or even equivalent to using a system/purpose built solution?
The linux kernel has no way to know if the memory its swapping out is even needed anymore. The android system, however, does know this - and will often discard allocations.
Let's say you run two applications: email and the browser. The browser has several pages loaded with flash, and lots of memory intensive stuff going on. Also in memory is the code that syncs your email in the background and several other "non critical" services (such as SMS, latitude, etc.) and a few critical services (such as some wifi support, display support, framework, etc.)
Keep in mind that if android requests memory, and there's a swapfile, the kernel will claim it has memory backed by swap... So given a large enough swapfile, the kernel will never tell android that it's running short on memory...
Given the above situation, the user now wants to run Angry Birds. There isn't enough physical RAM to support all of the above in memory AND Angry Birds. What will happen?
If there's no swapfile, android will see there isn't enough RAM to support it, and simply drop the browser and email client from memory, but keep the services in memory. Angry birds loads, and the user is happy.
IF there IS a swapfile, however, then android will see that there is RAM to support AB along with everything else in memory, and just load Angry Birds. When that happens, the linux kernel will have to swap pages of memory out to the flash memory. The KERNEL doesn't know the difference between the email client, the email service, the browser, or any other "non-critical" service. All those memory pages are flagged the same. So, perhaps the browser gets swapped out. (wasted cycles - it could have been discarded.) The email client is retained in RAM, but the email service is swapped out to flash. Angry Birds loads. 5 minutes later, Angry Birds freezes and gets jumpy... why? Because the email service has to be swapped back into RAM, and something else swapped out in its place. This time it was latitude. A few minutes later, latitude wants to update your position, so the same thing happens. What gets swapped this time?
Why spend the cycles swapping things in and out of RAM? There is plenty of memory on these devices to support all the services and memory hungry games. If some game has a memory leak, you SHOULD be getting errors from running out of memory and NOT blissfully swapping things to flash.
I'm not going to tell people how to use their devices. I'm going to try and give them advice, but I certainly can't force people to take it. As a matter of fact, I'll even encourage the technical minded to explore and break things to learn on their own.
However, when a person asks the question I see in the OP, and admits that they are new to linux, then I suspect that they aren't technically minded and exploring, but blindly following the "suggestion" of someone else who promises all kinds of silly things. It reminds me of someone who disabled kernel panic reboots and claimed that it was a tweak to make the system more stable... and had many people actually believing that.
There's a good reason why google hasn't enabled swapping, and there's even less of a reason with devices that come with 1GB of RAM.
Take care
Gary
---------- Post added at 01:45 AM ---------- Previous post was at 01:25 AM ----------
danielkaboom said:
is it me or is it gingerbread have better ram management than honeycomb, and so if it is, im trying to make swapfile in hope that its getting better. i use v6 supercharger, kill all proccess when it turn to standby by automatic, overclocking to 1,6ghz, but still i can make the ram more efficient when running on multitasking.
hope you understand for what im going to achieve.
thanks.
Click to expand...
Click to collapse
First of all, try the same thing without that "supercharger" script. I've made clear my thoughts on that. In this case, using that script may or may not be allowing HC to do what its designed to do in regards to memory management. I'm not saying you should delete it - but to run tests without it.
If you are running low on FREE memory, that's not a bad thing. What good is the memory doing if it's not being used? Android will let an unused application linger in RAM as long as they wants so long as nothing else needs that RAM. As soon as something else needs that RAM, those unused apps will be purged (garbage collection.)
Having a swap file directly contradicts any effort to purge things from memory. A swapfile will encourage the system to swap things to flash as virtual memory. Sure, your "free memory" number might be bigger, but it will slow the system down when it's swapping things out to and in from flash memory. (A blunt question Are you chasing numbers or actual performance?
How do you expect to make memory MORE efficient by always having it be unused? Memory that's not being used is wasted. If my desktop machine (that has 16GB of RAM) has only 6GB being used, then I have 10GB of RAM wasted. I'd rather that memory be used to store an application I might go back to using, or used as cache. Completely unused RAM is completely wasted RAM.
I understand that you might be caught up in the whole thing with overclocking, having as much free RAM as possible, and having nice benchmark numbers. The thing is.. NONE OF THAT MATTERS.
Want higher benchmark numbers? I can make you a kernel that will give you insanely high numbers. Your device will suck for actual use, but you'll get high benchmarks.
Want a big "free RAM" number? Never run any apps, never get email, don't do anything at all with the device. It'll be an expensive paperweight, but you'll always have lots of free (and completely wasted) RAM.
Try this: make a backup of your system and then go back to stock. Use your tablet in a factory state for a few days. Then root it and disable some of the things that might be chewing the battery. Don't overclock, don't install scripts, and don't install a custom kernel. Use the device like that for a while. Actually USE the device - don't benchmark it, check task managers, etc. Just use it.
Now, how does it feel? No script, kernel, or anything else will make a dramatic performance increase. They can (and often do) make things slower, however. (That's why I'm very careful about modifications I make to my kernel...)
After using it stock for a few days, come back and tell us what you think - what you wish would be better in actual day to day use. (Again, benchmarks and numbers don't mean much...)
Take care
Gary
yes Gary,...to be honest, im blindly follow every1 that claims can tweaks or anything like tha, but when i tested it and using it, if its making my device getting "better" i kept it, if its making it worse than before, i let go.
in my opinion, slow, fast or faster is relative, it depends on every1 needs. for me loading game such as finalstrike hd in 5 sec is fast, but maybe different to others by loading it 20-30 sec is acceptable.
but if you said swapfile is bad and will only making it worse, then i'll accept that, but after im testing it. for me, sugar is not sweet until my tounge said so, no offence.
again, thanks Gary for the explanation, thanks for opening my mind.
edit : ill try to follow your instruction first.
You should do what you feel like, but please don't get caught up in lots of people telling you that they have magic bullets to fix things (that really aren't even broken.)
That being said, you are having a technical problem and I just can't resist information sharing.
What directory are you trying to create the file in? /sdcard (or /mnt/sdcard) won't work.
Try /data
(/mnt/sdcard == /sdcard.. and they will force certain permissions via fuse/vold.) Unlike GB, with HC /data and /mnt/sdcard use the same space. (/mnt/sdcard is actually a fuse from /data/media.) (In GB, /data space was very limited. That's not the case with HC.)
Gary
still failed,...:
- create a file in /data (named swapfile.swp), using terminal
# dd if=/dev/zero of=/data/swapfile.swp bs=1024 count=128000
- check from root explorer, the file is now created.
# mkswap /data/swapfile.swp
# swapon /data/swapfile.swp
swapon /data/swapfile.swp = Function not implemented
any sugestion?
edit : the permission is now can be change to rw-r--r--(thx Gary)..but its still failed to swapon,..
edit 2 : from what i've read from other pages and sites,..is it because "kernel not support"?
garyd9 said:
Are you suggesting that using an OS-level "generic" swapfile on flash memory is better or even equivalent to using a system/purpose built solution?
Click to expand...
Click to collapse
There is no "system/purpose built solution" - the Dalvik VM uses the Linux kernel VMM functions for low level memory management (http://developer.android.com/guide/basics/what-is-android.html).
The linux kernel has no way to know if the memory its swapping out is even needed anymore. The android system, however, does know this - and will often discard allocations.
Click to expand...
Click to collapse
Yes it does. The VMM knows which pages are active, which are inactive, and - if an application has called free() on a pages it previously malloc()'d, it will know which pages are expired.
In fact, the VMM will often know more than the Dalvik VMs because each application runs in its own Dalvik thread with its own dedicated heap. Any individual Dalvik instance will only know the disposition of the heap for its own application.
The VMM, on the other hand, has visibility of all Dalvik threads and will know which threads are idle and which are active, which Dalvik threads have run garbage collection and free()'d a portion of their heap, etc.
Keep in mind that if android requests memory, and there's a swapfile, the kernel will claim it has memory backed by swap... So given a large enough swapfile, the kernel will never tell android that it's running short on memory...
Click to expand...
Click to collapse
No, it won't. That's not how the swapfile works. What you're describing is more akin to memory-mapped file I/O, which is related (in that the VMM plays a role in managing that address space) but not at issue (it's a completely separate operation from memory allocation and de-allocation).
Memory is requested by giving the kernel a malloc() command. The VMM will then check its page cache (the size of which is constrained by physical memory - regardless of whether there is a swapfile or not) and look for available space. If space isn't available, then the VMM will look for pages marked as expired. If there aren't enough expired pages, it will look for inactive pages (pages allocated by processes that are idle or supsended).
At this point, the VMM will either 1) discard the contents of the expired and/or inactive pages until enough free pages are available (if no swapfile is available) or 2), write the contents of the expired and/or inactive pages to the swapfile before discarding them until enough free pages are available.
Note that the presence or absence of the swapfile has no bearing on what pages are chosen. And again, regardless of whether there is a swapfile or not, if there aren't enough expired and/or inactive pages to get rid of, malloc() returns a null pointer. In otherwords, you will get out of memory errors even with a giant swapfile.
Given the above situation, the user now wants to run Angry Birds. There isn't enough physical RAM to support all of the above in memory AND Angry Birds. What will happen?
If there's no swapfile, android will see there isn't enough RAM to support it, and simply drop the browser and email client from memory, but keep the services in memory. Angry birds loads, and the user is happy.
IF there IS a swapfile, however, then android will see that there is RAM to support AB along with everything else in memory, and just load Angry Birds. When that happens, the linux kernel will have to swap pages of memory out to the flash memory. The KERNEL doesn't know the difference between the email client, the email service, the browser, or any other "non-critical" service. All those memory pages are flagged the same. So, perhaps the browser gets swapped out. (wasted cycles - it could have been discarded.) The email client is retained in RAM, but the email service is swapped out to flash. Angry Birds loads. 5 minutes later, Angry Birds freezes and gets jumpy... why? Because the email service has to be swapped back into RAM, and something else swapped out in its place. This time it was latitude. A few minutes later, latitude wants to update your position, so the same thing happens. What gets swapped this time?
Click to expand...
Click to collapse
So bearing in mind that the Linux kernel VMM is ultimately responsible for choosing what gets dropped or swapped out of memory and also bearing in mind that only inactive or expired pages are eligible to be dropped/swapped, we can see that the situation you describe will never happen.
The behavior of, from the user's perspective, what applications get shoved out of active memory (regardless of whether they end up in the swapfile or in /dev/null) doesn't change. In the same way that the Linux VMM will never drop pages associated with an active process (such as the email sync service, the Wifi driver, etc), the Linux VMM will likewise never swap these pages out either.
Why spend the cycles swapping things in and out of RAM? There is plenty of memory on these devices to support all the services and memory hungry games. If some game has a memory leak, you SHOULD be getting errors from running out of memory and NOT blissfully swapping things to flash.
Click to expand...
Click to collapse
Consider the scenario you spelled out previously - without the swapfile, the pages associated with the Browser app will get dropped and make room for Angry Birds. Good news: Angry Birds starts up faster.
With the swapfile, the pages associated with the Browser app will get swapped out to make room for Angry Birds. This will take longer since there's some file I/O involved. Bad news: Angry Birds starts up slower.
So what's the use case for the swapfile? What if you want to go back to the browser again? Without the swapfile, the Browser is gone. You have to launch it - the application binary needs to be read off disk, executed, the heap has to be re-allocated, re-initialized, and program data needs to be populated. The page you wanted is gone - you need to fetch that again. More waiting while it downloads from the server and the HTML code is rendered on the screen.
In this scenario, reading the heap back into memory from the swap file is actually more efficient than recreating it - even if you ignore the obvious benefit of not having to relaunch the app and reload the page, there's substantial overhead associated with relaunching the app.
So that's the use case - maybe it's not applicable to you if (although maybe someone who wants to go back and forth between Angry Birds and a cheat guide on a G1 might appreciate this) but if you are multitasking across several memory-intensive apps, then the benefit of not having to re-invent the wheel, so to speak, to recover the application state can outweigh the cost of paging the application state out to disk.
I'm not going to tell people how to use their devices. I'm going to try and give them advice, but I certainly can't force people to take it. As a matter of fact, I'll even encourage the technical minded to explore and break things to learn on their own.
However, when a person asks the question I see in the OP, and admits that they are new to linux, then I suspect that they aren't technically minded and exploring, but blindly following the "suggestion" of someone else who promises all kinds of silly things. It reminds me of someone who disabled kernel panic reboots and claimed that it was a tweak to make the system more stable... and had many people actually believing that.
Click to expand...
Click to collapse
I have no problem with dissuading people of the notion that some hack is going to instantly and unequivocally make their system better. But I think the proper response, especially on a forum like this, is to present the facts of the matter and not just a knee-jerk contrarion reaction. Simply dismissing the swapfile as a "BAD THING" doesn't really help the OP learn more about it, at the very least.
I'm with you on disabling kernel panic reboots, though. That's just stupid.
There's a good reason why google hasn't enabled swapping, and there's even less of a reason with devices that come with 1GB of RAM.
Click to expand...
Click to collapse
Maybe, maybe not. Android 2.1 and earlier didn't implement JIT. Android 2.2 and earlier didn't implement EXT4. Android 2.3 and earlier didn't implement GPU-accelerated UI compositing. Android 3.2 and earlier didn't implement ASLR. Does that mean these were considered undesirable by Google at one point in time? Or were they always on Google's list of things they wanted to do and they just hadn't gotten around to them yet?
---------- Post added at 01:56 AM ---------- Previous post was at 01:41 AM ----------
danielkaboom said:
still failed,...:
- create a file in /data (named swapfile.swp), using terminal
# dd if=/dev/zero of=/data/swapfile.swp bs=1024 count=128000
- check from root explorer, the file is now created.
# mkswap /data/swapfile.swp
# swapon /data/swapfile.swp
swapon /data/swapfile.swp = Function not implemented
any sugestion?
edit : the permission is now can be change to rw-r--r--(thx Gary)..but its still failed to swapon,..
edit 2 : from what i've read from other pages and sites,..is it because "kernel not support"?
Click to expand...
Click to collapse
Yes, the kernel needs to have swapfs support. If you've ever played around with EXT4 kernels or ROMs that required EXT4 kernels, for example, it's kind of the same idea.
It sounds like the stock GT7+ kernel does not have this so you will need to find a custom kernel that does. I'm going to go out on a limb and guess that garyd9's kernel does not support swapfs.
Without the kernel, you're out of luck.
Regarding your situation on your Tab, it sounds like you've got an app or two that's misbehaving. Have you tried throwing up a CPU monitor? It would be useful to know whether the slowdown is caused by the CPU getting busy, and whether this load is from a single app or not.
Thank you for explaining that. Are there any examples, other than the one you mentioned, in which Android would benefit from a swapfile?
reading both pros and cons about swapfile really makes my head spinning,... im trying to understand it little by little. thanks guys for the explanation.
and yeah, guess im run out of luck,..(cause i don't have enough skill to make the kernel on my own,..sigh).
thanks.
danielkaboom said:
reading both pros and cons about swapfile really makes my head spinning,... im trying to understand it little by little. thanks guys for the explanation.
and yeah, guess im run out of luck,..(cause i don't have enough skill to make the kernel on my own,..sigh).
thanks.
Click to expand...
Click to collapse
It is a complicated issue with lots of tradeoffs in both directions.
I'm still curious as to the specifics of your problems, though. Garyd9 is correct in saying that creating a swapfile may not help your particular issue but that doesn't mean there isn't some other way to fix it. We just need more information about what's going on on your tablet.
---------- Post added at 05:49 PM ---------- Previous post was at 05:29 PM ----------
nyarltep said:
Thank you for explaining that. Are there any examples, other than the one you mentioned, in which Android would benefit from a swapfile?
Click to expand...
Click to collapse
Fundamentally, it breaks down to a store vs. recalculate issue - do you store memory pages to the swap file and incur the storage I/O overhead or do you discard it and recalculate it later and incur the cpu and memory I/O overhead? All of these resources are in short supply on the GT7+.
A swapfile works best with applications that maintain steady states that can easily be swapped out and back in as needed. A swapfile is least effective for active background processes.
If, for example, you're running out of memory running too many apps in the background - think clients for sync services, streaming media, system monitoring, etc. - a swapfile is not going to help.
However, if you're running into situations where you are switching between multiple apps such as document viewers/editors, and are finding that you need to reload documents as the apps get silently killed in the background, a swapfile could potentially help.
The only real way to know is to test it but without a kernel with swapfs support for the GT7+, it's impossible to say for certain.
from the opinion, i guess using swapfile for backround process is useless, but using it to switching task (for example : im using browser with lot of pages and beside that im doing some paperwork on office aplication) will help a bit, am i r8? if its r8, then im willing to try using swapfile, because i already freeze/uninstall some aplication that running on backround but still give me lags, when i did the example above.
but again, im running out of luck,..until Garyd9 or any1 else kind enough to make kernel that support swapfs,...
thanks for both of you, for your effort to answering my noob question.
regards,
dan
PS : Gary, i've tried your instruction, and yes it makes my daily use better,...though im still curious using swap,...hehehe.
danielkaboom said:
from the opinion, i guess using swapfile for backround process is useless, but using it to switching task (for example : im using browser with lot of pages and beside that im doing some paperwork on office aplication) will help a bit, am i r8? if its r8, then im willing to try using swapfile, because i already freeze/uninstall some aplication that running on backround but still give me lags, when i did the example above.
but again, im running out of luck,..until Garyd9 or any1 else kind enough to make kernel that support swapfs,...
Click to expand...
Click to collapse
Background processes are fine to swap out if they're steady state, it's active background processes that aren't going to benefit from a swapfile.
However, the lags you're experiencing may continue to persist depending on what is causing those lags. A swapfile won't help if you've got a poorly-optimized app running, particularly one that is not efficient with memory allocations. It also won't help if the lags are caused by a Dalvik thread performing garbage collection on its heap (whether the app on that thread is efficient in its memory allocations or not).
My educated guess is that if you are experiencing lags while using an active, foreground application, then this is not a problem that will be fixed with a swapfile. On the other hand, if you are experiencing lags launching new applications or bringing background apps into the foreground, these types of lags may be reduced with the use of a swapfile though the only way to know for sure is to test it.
I don't have time for an indepth reply to h2g2, but I'll reply simply:
You seem to be knowledgable enough to recompile a kernel - so please feel free to pull my kernel sources and initramfs, turn on swapping (samsung has it disabled by default), and try it. Keep an eye on the swapping and memory stats, as well as what's being swapped, etc... You might be surprised.
(If I had time, I'd do the same.. I've been wrong before and I might be wrong again... )
In either case, Daniel, I'm glad that turning off all that excess crap helps. As much as we all complain about this tablet, it actually runs pretty good without many modifications. If you read the changes I've made in the p6210 kernel, you'll see that I really haven't done much to it. The most invasive change was adding stuff that Samsung didn't have in there (such as UV.)
Take care
Gary
garyd9 said:
I don't have time for an indepth reply to h2g2, but I'll reply simply:
You seem to be knowledgable enough to recompile a kernel - so please feel free to pull my kernel sources and initramfs, turn on swapping (samsung has it disabled by default), and try it. Keep an eye on the swapping and memory stats, as well as what's being swapped, etc... You might be surprised.
(If I had time, I'd do the same.. I've been wrong before and I might be wrong again... )
Click to expand...
Click to collapse
Just to be clear, I have no real stake in this except to make sure that the technical facts about the swapfile are presented properly. In much the same way that you've been frustrated hearing about people recommending that they disable kernel panic reboots, I also am frustrated when people have a knee-jerk "swapfile = terrible" reaction that is largely based on FUD.
That said, you're right, I should just test it myself when I've got some free time.
Dusted off my old Nexus One, loaded up a clean install of CM7 and installed a kernel with CONFIG_SWAP=y. I decided to go with a swap partition on my sd card rather than a swapfile but the effect should be the same.
I haven't had time to do extensive testing but so far but I can confirm that swap is working and I haven't yet noticed a major perceptible impact to performance of the device.
Code:
# free
total used free shared buffers
Mem: 403240 379288 23952 0 60
-/+ buffers: 379228 24012
Swap: 62696 27948 34748
# grep "pswp" /proc/vmstat
pswpin 192
pswpout 7059
---------- Post added at 01:37 PM ---------- Previous post was at 12:49 PM ----------
Been switching back and forth between apps for a while now, paying particular attention to apps like Google Earth and the Browser that load up lots of data.
One particular test that seemed to stress the memory subsystem was using the "Print this page" on multi-page articles on graphics-heavy sites like, e.g. Anandtech (had the Snapdragon S4 review up). With swap enabled, there was a delay of 1-2 seconds when switching back to the browser (no doubt from reading the appropriate pages back into memory) but without the swapfile, the session was gone and the page needed to be reloaded, which took much longer than 1-2 seconds.
Some caveats:
1) I used a rather small swap partition (64MB) compared to the amount of memory available on the device (512MB for the N1). This means that I didn't need to do too much tweaking to the lowmemorykiller settings.
2) I set swappiness to 100, which is intentionally a bit heavy-handed (default seems to be 60).
3) I did not tweak other settings such as dalvik.vm.heapsize, vfs.
_cache_pressure, page-cluster and, as mentioned in #1, lowmemorykiller/parameters/minfree.
Code:
# free
total used free shared buffers
Mem: 403240 390824 12416 0 36
-/+ buffers: 390788 12452
Swap: 62696 59684 3012
# grep "pswp" /proc/vmstat
pswpin 6061
pswpout 31228
h2g2 said:
Dusted off my old Nexus One, loaded up a clean install of CM7 and installed a kernel with CONFIG_SWAP=y. I decided to go with a swap partition on my sd card rather than a swapfile but the effect should be the same.
I haven't had time to do extensive testing but so far but I can confirm that swap is working and I haven't yet noticed a major perceptible impact to performance of the device.
Code:
# free
total used free shared buffers
Mem: 403240 379288 23952 0 60
-/+ buffers: 379228 24012
Swap: 62696 27948 34748
# grep "pswp" /proc/vmstat
pswpin 192
pswpout 7059
---------- Post added at 01:37 PM ---------- Previous post was at 12:49 PM ----------
Been switching back and forth between apps for a while now, paying particular attention to apps like Google Earth and the Browser that load up lots of data.
One particular test that seemed to stress the memory subsystem was using the "Print this page" on multi-page articles on graphics-heavy sites like, e.g. Anandtech (had the Snapdragon S4 review up). With swap enabled, there was a delay of 1-2 seconds when switching back to the browser (no doubt from reading the appropriate pages back into memory) but without the swapfile, the session was gone and the page needed to be reloaded, which took much longer than 1-2 seconds.
Some caveats:
1) I used a rather small swap partition (64MB) compared to the amount of memory available on the device (512MB for the N1). This means that I didn't need to do too much tweaking to the lowmemorykiller settings.
2) I set swappiness to 100, which is intentionally a bit heavy-handed (default seems to be 60).
3) I did not tweak other settings such as dalvik.vm.heapsize, vfs.
_cache_pressure, page-cluster and, as mentioned in #1, lowmemorykiller/parameters/minfree.
Code:
# free
total used free shared buffers
Mem: 403240 390824 12416 0 36
-/+ buffers: 390788 12452
Swap: 62696 59684 3012
# grep "pswp" /proc/vmstat
pswpin 6061
pswpout 31228
Click to expand...
Click to collapse
little of my understanding, if a swapfile is made in an external sd, the sd card must have good r/w capability (minimum required a class 6 sd card), what if the swapfile is made in internal sd (since GTab have 12gb planted chip memory), what is the effect?
and so,....would you be kind enough to build a kernel for GTab 7+ that support swapfile? and if you do, can you do with a flashable zip (which i can flash it through cwm recovery?
so i can answer my own question : swap or not to swap?
and of course if you have spare time
thanks
dan
danielkaboom said:
little of my understanding, if a swapfile is made in an external sd, the sd card must have good r/w capability (minimum required a class 6 sd card), what if the swapfile is made in internal sd (since GTab have 12gb planted chip memory), what is the effect?
and so,....would you be kind enough to build a kernel for GTab 7+ that support swapfile? and if you do, can you do with a flashable zip (which i can flash it through cwm recovery?
so i can answer my own question : swap or not to swap?
and of course if you have spare time
thanks
dan
Click to expand...
Click to collapse
I'm using a Class 2 8GB MicroSDHC card from Sandisk on my Nexus One for testing and it seems to be fine. I'd recommend using an external SD because it's replaceable and swap I/O will wear out your flash faster so you're better off segregating it.
I took a look at the state of the kernel source for the GTab7+ at the moment and it looks like the Samsung sources are out of date and a kernel built from the current sources won't run properly on the LA3 firmware (Garyd9 notes this in the thread for his kernel as well) so right now, building a custom kernel is a nonstarter for me because the LA3 firmware fixed some pretty major shutdown issues for me on my Tab.
Perhaps when the ICS sources are released, I'll take another look.

Best optimization hack in my experience: RAMEXPANDER

TL;DR Ramexpander set at 4gb swap file makes all the difference for this tablet
A little background: I've been modifying my phones since the galaxy nexus. I've tried greenify, amplify, debloating, kernels, overclocking, cleaning, l-speed, etc. I like to run a lot of apps, and all of my phones and devices, including the Nexus 6p (until the Pixel XL) lagged. RamExpander has been the solution every time, and the fire hd is no different. This one: https://play.google.com/store/apps/details?id=com.swapit.expander.de&hl=en .
Use the free version here to check if your device is compatible: https://play.google.com/store/apps/details?id=com.roehsoft.meminfo&hl=en but I know a rooted 2017 Hd 10 running 5.6 is compatible.
Maybe your device runs perfectly already and/or you're using less apps. That's great! But I have seen a few threads about trying to optimize performance. IF your device lags, this app will make an immediate night and day difference.
I'll give it a try
I have L Speed and Greenify installed on all of my rooted Android devices. Could you please explain to us how RAMEXPANDER is better than L Speed/Greenify? I'm curious. I'll do anything to optimize these Fire HDs even more. I rooted them and installed Google everything on them so my parents don't have to deal with the Fire OS.
Is Ram Expander really worth $10? I wanted to try it and found an APK. The damned thing was contaminated with neverending ads appearing every 10 seconds... I had to uninstall and run Malwarebytes to get the tablet working fine again. I assume the "real" paid version has no crappy ads?
---------- Post added at 01:09 AM ---------- Previous post was at 01:08 AM ----------
bakshi said:
I have L Speed and Greenify installed on all of my rooted Android devices. Could you please explain to us how RAMEXPANDER is better than L Speed/Greenify? I'm curious. I'll do anything to optimize these Fire HDs even more. I rooted them and installed Google everything on them so my parents don't have to deal with the Fire OS.
Click to expand...
Click to collapse
I know Greenify already and use it on my tablets and cell phones. But it's the 1st time ever I hear about L Speed. Is it complicated to set up?
The 2GB memory is pretty limited, and disabling some Amazon services and avoiding apps that remain persistent in memory is highly recommended. I installed the official Google app to get Google Assistant, but found that it used too much ram. I recommended installing system monitor and monitoring the active processes, sorted by ram usage, to identify bloated user apps.
bakshi said:
I have L Speed and Greenify installed on all of my rooted Android devices. Could you please explain to us how RAMEXPANDER is better than L Speed/Greenify? I'm curious. I'll do anything to optimize these Fire HDs even more. I rooted them and installed Google everything on them so my parents don't have to deal with the Fire OS.
Click to expand...
Click to collapse
so what ram expander does is it's just a super easy way to setup a swap file (space on the internal sd card that will be used as RAM). Why is it better than all the other stuff I've tried? It's empirical, not logical. That is to say, every phone that's lagged, if RAMEXPANDER is compatible, I've installed and it's made a huge difference in performance, every single time. I've messed around with a lot of optimization tools beforehand and results have been mixed. I can improve battery life usually, but the phone will still lag, with those tools and with all the apps i run. Also, each tool is just more strain on the system.
metaleloi666 said:
Is Ram Expander really worth $10? I wanted to try it and found an APK. The damned thing was contaminated with neverending ads appearing every 10 seconds... I had to uninstall and run Malwarebytes to get the tablet working fine again. I assume the "real" paid version has no crappy ads?
---------- Post added at 01:09 AM ---------- Previous post was at 01:08 AM ----------
I know Greenify already and use it on my tablets and cell phones. But it's the 1st time ever I hear about L Speed. Is it complicated to set up?
Click to expand...
Click to collapse
I've never seen an add in the app. You got a bad APK.
An alternative, I've found, though less intuitive is an app called apps2sd. https://play.google.com/store/apps/details?id=in.co.pricealert.apps2sd&hl=en
It's a little less intuitive, but basically when you open the app, you get a bunch of tools to choose from. If you choose the SWAP menu, you can create a SWAP Partition on the /data partition. 4gb has been working amazingly for me. Then go to settings and check the "apply swap on boot" (after you test it for a while, and you're happy and everything's stable).
L-speed has a lot of options. It's got a few profiles, but I'm not sure that they actually work. With some messing around you can get a little improvement here and there (or maybe it's placebo). Sometimes an update of L-speed will bootloop your device, but I only use it on devices I have an nandroid ready to go on.
SWAP, through ram expander or apps2sd, makes a night and day difference compared to any other tool I've tried.
Does Ram Expander starts automatically at each reboot or it has to be started manually each time?
mistermojorizin said:
so what ram expander does is it's just a super easy way to setup a swap file (space on the internal sd card that will be used as RAM). Why is it better than all the other stuff I've tried? It's empirical, not logical. That is to say, every phone that's lagged, if RAMEXPANDER is compatible, I've installed and it's made a huge difference in performance, every single time. I've messed around with a lot of optimization tools beforehand and results have been mixed. I can improve battery life usually, but the phone will still lag, with those tools and with all the apps i run. Also, each tool is just more strain on the system.
I've never seen an add in the app. You got a bad APK.
An alternative, I've found, though less intuitive is an app called apps2sd. https://play.google.com/store/apps/details?id=in.co.pricealert.apps2sd&hl=en
It's a little less intuitive, but basically when you open the app, you get a bunch of tools to choose from. If you choose the SWAP menu, you can create a SWAP Partition on the /data partition. 4gb has been working amazingly for me. Then go to settings and check the "apply swap on boot" (after you test it for a while, and you're happy and everything's stable).
L-speed has a lot of options. It's got a few profiles, but I'm not sure that they actually work. With some messing around you can get a little improvement here and there (or maybe it's placebo). Sometimes an update of L-speed will bootloop your device, but I only use it on devices I have an nandroid ready to go on.
SWAP, through ram expander or apps2sd, makes a night and day difference compared to any other tool I've tried.
Click to expand...
Click to collapse
Thanks for this. Just did this with app2sd and working great!
metaleloi666 said:
Does Ram Expander starts automatically at each reboot or it has to be started manually each time?
Click to expand...
Click to collapse
It has an auto start feature
metaleloi666 said:
Is Ram Expander really worth $10? I wanted to try it and found an APK. The damned thing was contaminated with neverending ads appearing every 10 seconds... I had to uninstall and run Malwarebytes to get the tablet working fine again. I assume the "real" paid version has no crappy ads?
Here is a link for the premium: https://uplod.cc/4ogqacud4av9
If that doesn't work, check this link out: https://apk4free.net/roehsoft-ram-expander/
Click to expand...
Click to collapse
I keep trying to install this (the Google Play store version of ROEHSOFT RAM Expander) on a Fire HD10 with root via Kingoroot. I'm trying to install the swap disk on the SD card, and I'm getting an error message:
You have a Limited Kernel
Kernel Swapspace Limit detected! please reduce the Swapfile Size lower 1GB! and try again!
This happens no matter what size I pick for the swap file on the SD card.
If I try to use the same company's "test" app (MemoryInfo-SwapCheck), I get this error message:
Path Error
This Path is not usable for Swap!
I can verify that both apps are successfully creating the swap file on the SD card (swapfile.swp or swaptestf.swp, depending on which app I'm using).
I've tried both systems 5.5.0.0 and 5.6.0.1 and I get the same error message on either. I've tried installing it on a completely fresh install of both, with only Kingoroot, SuperSU, Google Play, and RAM Expander installed (in that order). I've also tried swapping out SD cards, and get the same error on both.
This software does work properly if I install the swap file on internal memory, but I'd prefer not to do that, since I can't replace the internal memory if I wear it out.
The weird thing is, I could swear it was working properly before (a couple of weeks ago), but nothing is getting this to work now. It's possible I was mistaken and had accidentally chosen the internal memory, but I don't think so.
Anyone have any clue about what's going on?
GamerOfRassilon said:
I keep trying to install this (the Google Play store version of ROEHSOFT RAM Expander) on a Fire HD10 with root via Kingoroot. I'm trying to install the swap disk on the SD card, and I'm getting an error message...
Click to expand...
Click to collapse
To respond to myself (in case anyone else has this problem in the future):
For some reason, this software doesn't work if you set the path to /storage/sdcard1 (It will create the swap file, but then it gives the error message I described).
Instead, you have to use:
/mnt/media_rw/sdcard1
Then it works totally fine.
Also, if it's useful (and saves anyone else time), here are the values that each option of this software generates on the HD10:
multitasking
SwpFile = 3000MB
Swappiness = 100
MinFreeKB = 54MB
DriveCache(KB) = 4096
balanced
SwpFile = 3000MB
Swappiness = 100
MinFreeKB = 62MB
DriveCache(KB) = 8192
gamers
SwpFile = 3000MB
Swappiness = 100
MinFreeKB = 62MB
DriveCache(KB) = 16384
net gamers
SwpFile = 3000MB
Swappiness = 100
MinFreeKB = 4MB
DriveCache(KB) = 1024
I have no idea what those options mean or do, but I went with "balanced" (since it seemed pretty middle of the road) but with SwpFile set to 4000MB instead of 3000MB.
Ramexpander etc.
I've paid for and been using RAMExpander for awhile now. It's a good app, and worth the money. That being said, App2SD is also an incredibly useful app, Pro or no. L-Speed is great as well. One thing to note, from what I've researched, editing your zram is also helpful as it compresses items in memory to free up space, and it is prioritized over Swap. Using the two in conjunction (having a zram file (250-500 MB seems to do the trick but you could probably go lower) and a decent sized swap file(mine is 8GB but I suspect this is massive overkill and 4 would work)) has left me with little to no lag, especially when paired with L-Speed's other exceptional tweaks. Jade Empire and Kotor run with 0 lag at top graphical settings.
Hope this helped clear up any questions.
Edit: If you use App2SD's partition manager you can set yourself up with a partition dedicated exclusively to Swap, then in Ramexpander change swap location to this partition in the settings. Ramexpander tops you out at 4GB, doing this is a good way to increase that threshold.
mistermojorizin said:
so what ram expander does is it's just a super easy way to setup a swap file (space on the internal sd card that will be used as RAM). Why is it better than all the other stuff I've tried? It's empirical, not logical. That is to say, every phone that's lagged, if RAMEXPANDER is compatible, I've installed and it's made a huge difference in performance, every single time. I've messed around with a lot of optimization tools beforehand and results have been mixed. I can improve battery life usually, but the phone will still lag, with those tools and with all the apps i run. Also, each tool is just more strain on the system.
I've never seen an add in the app. You got a bad APK.
An alternative, I've found, though less intuitive is an app called apps2sd. https://play.google.com/store/apps/details?id=in.co.pricealert.apps2sd&hl=en
It's a little less intuitive, but basically when you open the app, you get a bunch of tools to choose from. If you choose the SWAP menu, you can create a SWAP Partition on the /data partition. 4gb has been working amazingly for me. Then go to settings and check the "apply swap on boot" (after you test it for a while, and you're happy and everything's stable).
L-speed has a lot of options. It's got a few profiles, but I'm not sure that they actually work. With some messing around you can get a little improvement here and there (or maybe it's placebo). Sometimes an update of L-speed will bootloop your device, but I only use it on devices I have an nandroid ready to go on.
SWAP, through ram expander or apps2sd, makes a night and day difference compared to any other tool I've tried.
Click to expand...
Click to collapse
Blaiser47 said:
Thanks for this. Just did this with app2sd and working great!
Click to expand...
Click to collapse
How did you set it up?
I swaped it on Sd card on my j7 & it became to freeze & became super slow...
What about using BK Disabler?
ThisCrimsonDiscordia said:
I've paid for and been using RAMExpander for awhile now. It's a good app, and worth the money. That being said, App2SD is also an incredibly useful app, Pro or no. L-Speed is great as well. One thing to note, from what I've researched, editing your zram is also helpful as it compresses items in memory to free up space, and it is prioritized over Swap. Using the two in conjunction (having a zram file (250-500 MB seems to do the trick but you could probably go lower) and a decent sized swap file(mine is 8GB but I suspect this is massive overkill and 4 would work)) has left me with little to no lag, especially when paired with L-Speed's other exceptional tweaks. Jade Empire and Kotor run with 0 lag at top graphical settings.
Hope this helped clear up any questions.
Edit: If you use App2SD's partition manager you can set yourself up with a partition dedicated exclusively to Swap, then in Ramexpander change swap location to this partition in the settings. Ramexpander tops you out at 4GB, doing this is a good way to increase that threshold.
Click to expand...
Click to collapse
Just out of curiosity, what are your L Speed settings?
I went with App2SD and L-Speed after reading this thread, and wow, it's practically a different experience, a different tablet. If you aren't doing something similar you're purposefully using a tablet that is gimped.
Here are the settings I went with:
App2SD swap is set to 4GB and placed in /data.
L-Speed has everything turned on as it would when first installed.
RAM Manager is set to balanced, seems like more than enough and I don't want to be plugged in frequently.
zRAM Optimization is set to on.
I then went back to swap settings and set the zRAM to priority 0 and /data set to 1.
Turned improved scrolling on.
Everything else was left as is, for now.
I can't believe this is the same tablet I was using a week ago.
No need for Greenify with this combination.
What size should i set the swap partition to?
Since the swap will be on the sd card, should I go with the Samsung MicroSDXC EVO Plus which has 100/60 read/write rates or the Samsung PRO Endurance which has better reliability (designed for continuous writes) in the long run but only 100/30 read/write?
lanbladez said:
What size should i set the swap partition to?
Since the swap will be on the sd card, should I go with the Samsung MicroSDXC EVO Plus which has 100/60 read/write rates or the Samsung PRO Endurance which has better reliability (designed for continuous writes) in the long run but only 100/30 read/write?
Click to expand...
Click to collapse
You could probably get away with 2GB, honestly. In which case, I'd really suggest putting it on internal in /data.
Just one less I/O delay (even if seemingly trivial, will cause lag) to deal with.
If you're going with putting the swap on an SD rather than internal, definitely the fastest SD you can use. :fingers-crossed:
If you must put it on the SD, at the least create a zram "swap" on internal, it only has to be ~150-300MB.

Categories

Resources