Hey Guys,
I was just around XDA and I was reading about someone who was saying that the Ram Swap have the "opinion" to not be useful at all but someone else who complain about the ram consumption saying that Swap is needed at must if on low Ram, and that was said from Power Users on XDA.
I understand that on High-End Devices this script not have space in the first place but I want to go extreme. Why Not?
Like all we know we have enough Ram to share but we also know that all the latest applications and Games eat a lot of Ram and when they consume Ram in excess Android will kill all the applications in background to let other applications working well.
Let's said that 2GB of Ram (1,66GB effective) it's not much on our Z1 and probably nobody take my idea seriously but I think that after few years when huge applications will come out on our devices, hungry of ram, then you will see that maybe this will help.
So my question is if it will be possible to expand the Ram with Swap on SD to let Android not kill Applications and have more Ram (virtual and real) to share. Like 1,66 real + 1GB Swap?
Do you think it will be a good Mod? It's difficult to make it real? It will be ever available on our Z1?
Well the Z1 only has 11gb or usable internal memory and i wouldnt want to make 1 or 2 of that useless just in case i run out of 1.7gb of ram on the device which doesnt happen very often. and the other thing is if you actually make a swap partition and manage to set it up , then when you run out of ram and device start to use the sd card or the external sd (which i think is even slower) as a ram the phone will start to run extremely slow compare to normal. i think swap partition make more sense on a linux production machines or a server when you cant afford any programme to be shut down. having said that if the mod is ever going to be availible ill probably make 500Mb swap just incase
Yes it is possible to make a swap partition on the Z1, just don't bother with it. Swap is really slow, your apps won't get killed but it will take a very long time to open them again since your internal memory/sd-card is that much slower than the RAM in your device.
You could try messing around with the Android minfree settings but other than that, deal with it. Try searching on Google for some tutorials on customizing your minfree settings.
Related
So from what I understand linix swap is a method to make your phone run faster. My phone has been acting a bit sluggish lately when loading the home screen.
When partitioning my sd card (using ra recovery) it asked how large of a swap to use, I checked another thread and found out that the recommened size for cupcake is 64mb. I set it at that. Is my phone currently using the swap or do I need to activate it/ use an app
In addition to the obove questions could someone outline the advantages/disadvantages.
Thanks a lot for any help.
asb123 said:
So from what I understand linix swap is a method to make your phone run faster. My phone has been acting a bit sluggish lately when loading the home screen.
When partitioning my sd card (using ra recovery) it asked how large of a swap to use, I checked another thread and found out that the recommened size for cupcake is 64mb. I set it at that. Is my phone currently using the swap or do I need to activate it/ use an app
In addition to the obove questions could someone outline the advantages/disadvantages.
Thanks a lot for any help.
Click to expand...
Click to collapse
In cyanogen you will need to edit the user.conf or userinit.sh, I'm not sure which, to activate linux-swap as he uses compcache as default
It depends on who you ask... CompCache (CC), IMO, is better than swap for many reasons, the most of which is that it seems to be faster in scientific testing, and the best test of all, the seat of your pants test.
The problem with CC is that if you want to flash a ROM that is huge, ie a Hero ROM, you run out of room, so it becomes slower compared to a swap where you are actually adding "RAM" by using the SD card to do this. Some have been able to make Hero small enough to work with CC, but not enough for most people wanting all the bells and whistle's of Hero.
CC has some draw backs, the biggest being that it is slower than no CC in a solo task since the CPU has to uncompress the data when you re-open a program (You really see this when you open your browser back up and it takes 5 seconds to "reload" the page). But this is about the only real draw back.
Swap has a few more draw backs... it burns up your SD card, although it isn't a "huge" deal, it is still a draw back. As well, like CC, the CPU has to pull this data off the SD card, it isn't just sitting in memory like true RAM, so it's speed is limited by the speed of the SD card and the speed of the G1 at reading the SD card. In the end, since swap tends not to be compressed anywhere close to what CC is, it ends up being not that big of a deal in terms of actual speed... ie the browser might take half a second longer to open than CC right out of the box, but if you end up with 15 apps running and Rosie(what makes a Hero ROM a Hero ROM) it will take less time since it is at least still in the "RAM" and doesn't have to be re-opened 100%.
I hope this makes sense, and for those wiser than I, if I misrepresented let me know and I shall bow down like red chowder bows down to white chowder.
you can also use the app "user.conf v.030"
that's what i use, because i can control swappiness
i have now compcach enabled 64MB, ccbackinswap (swappiness 50), and 128MB linux-swap (swappiness 50)
works like a charm
shmigao said:
you can also use the app "user.conf v.030"
that's what i use, because i can control swappiness
i have now compcach enabled 64MB, ccbackinswap (swappiness 50), and 128MB linux-swap (swappiness 50)
works like a charm
Click to expand...
Click to collapse
And I take it that this will make my phone run quicker? My phone has been a bit sluggish in loading the home dash
would this make my phone run quicker? and cold you explain swappiness
asb123 said:
would this make my phone run quicker? and cold you explain swappiness
Click to expand...
Click to collapse
It depends, try it out and see how it works for you. Every person uses their phone differnetly, so for some it is an improvement, for others it is not.
And "swappiness" means the actual amount of data being swapped...
ie:
I have my linux-swap partition at 200MB, and my swappiness set at 96MB, meaning that only 96MB of data are actually being swapped on to the SD card.
Now, I don't use swap at all myself on donut, I stick to compcache or nothing depending on what the chef decided to do. If it uses swap out of the box, I will turn it off and put it onto compcache for a donut build.
Before you start playing around with swap, maybe get a task killer installed and use it sparingly (Android runs better when you don't kill stuff because of the way it is designed, but there is a limit, so task killers are nice, especially to kill something like music player or video player running in the background) This will speed things up just by keeping heavy CPU/RAM use programs actually fully closed.
Also, how slow is slow? At first, any ROM fly's on snapping back etc... but they all slow down a bit, some more than others. Actions should not and will not be instant, they should take time... not 15 seconds, but if it takes a second to load the home screen, so be it, that is damn good my friend.
Hi,
First post here, but have followed these forums for a while.
Just a quick question. I just recently updated to Cyanogen 4.2.14.1 for my Dream. Everything works fine and smooth, and with the ram hack I noticed this even more. But I notice that when first booting my phone up, that after running Advanced Task Killer and stopping all apps after letting the phone boot, that my available memory can get as high as 45mb.
Problem is, it never stays that high, and normally after an hour or so, I average around 28-34mb available memory, even after closing all applications and running ATK again.
Is that pretty standard for the G1 on this build? And if not, is there something I should be doing to increase the available memory?
The build runs great (much better than 4.2.13), but it seems that when I see screenshots of ATK on other peoples G1's, that they are getting more memory.
Any suggestions for me?
Thanks
It's by design
Im not sure I get what you mean. Can you be a bit more specific?
I think what the poster meant is that the ROM was designed to utilize your RAM as much as possible to keep things running fast and smooth. As long as your phone is still running fast, why worry about it?
Dai323 said:
Hi,
First post here, but have followed these forums for a while.
Just a quick question. I just recently updated to Cyanogen 4.2.14.1 for my Dream. Everything works fine and smooth, and with the ram hack I noticed this even more. But I notice that when first booting my phone up, that after running Advanced Task Killer and stopping all apps after letting the phone boot, that my available memory can get as high as 45mb.
Problem is, it never stays that high, and normally after an hour or so, I average around 28-34mb available memory, even after closing all applications and running ATK again.
Is that pretty standard for the G1 on this build? And if not, is there something I should be doing to increase the available memory?
The build runs great (much better than 4.2.13), but it seems that when I see screenshots of ATK on other peoples G1's, that they are getting more memory.
Any suggestions for me?
Thanks
Click to expand...
Click to collapse
To expand on the other post, what good is ram if it is always free forcing applications to reopen. Wouldn't you rather have 15-20mb free ram to load new programs while keeping some of the programs you use often in ram, then have those get bumped out when more ram is needed.
futangclan said:
I think what the poster meant is that the ROM was designed to utilize your RAM as much as possible to keep things running fast and smooth. As long as your phone is still running fast, why worry about it?
Click to expand...
Click to collapse
Cause theres a difference between running "fast", and "as fast as possible
Im just trying to make sure Im utilizing the roms to their best potential, and I simply wanted to make sure that was I was experiencing was normal.
evilkorn said:
To expand on the other post, what good is ram if it is always free forcing applications to reopen. Wouldn't you rather have 15-20mb free ram to load new programs while keeping some of the programs you use often in ram, then have those get bumped out when more ram is needed.
Click to expand...
Click to collapse
You make a good point. I was just confused as it seems I hear alot of people saying they can achieve 45 to 50mb available memory on a G1. I so far cant find a way to do this. Nonetheless, the rom runs super.
Thanks for answering guys.
Thanks, that was the point I was trying to get at.
evilkorn said:
To expand on the other post, what good is ram if it is always free forcing applications to reopen. Wouldn't you rather have 15-20mb free ram to load new programs while keeping some of the programs you use often in ram, then have those get bumped out when more ram is needed.
Click to expand...
Click to collapse
I've noticed that my G1 (Running CM6) tends to run out of RAM fairly often, I was thinking maybe having swap space might help me a bit with this, however I only have a Class 2 SDHC Card (16GB), would I see any performance increment or should I just wait until I can afford a much faster one? (eg. The Kingston Class 10 one)
I would suggest to use no swap at all ... if RAM is too low, try to enable compcache it will help you probably a bit. I noticed a massive performance drop when enabling swap on CM6.
Sent from my Htcclay's Superfly G1 using XDA App
Swap and CM5/6 don't get along. The memory killer in the kernel thinks that swap is actually free RAM and keeps more things open, stopping tasks from being killed at all. If you want to use swap, I recommend you use a donut/cupcake/hero rom that uses a different kernel so that things don't get down to a screeching halt. And anyways, the fastest speed I have ever seen my phone write something from my computer to the phone via USB is 2.7mb/s, compared with 6-12mb/s I get from an sdcard reader. That means that even when your phone is writing at top speed, it is just barely far from the 2mb/s write speed guaranteed by a class 2. You will definately see better performance with swap on a class 4, but anything higher won't benefit your phone much at all, unless you regularly transfer large amounts of files to your memery card via a card reader.
AndDiSa said:
I would suggest to use no swap at all ... if RAM is too low, try to enable compcache it will help you probably a bit. I noticed a massive performance drop when enabling swap on CM6.
Sent from my Htcclay's Superfly G1 using XDA App
Click to expand...
Click to collapse
Compcache didn't improve performance at all, for me at least.
mejorguille said:
Swap and CM5/6 don't get along. The memory killer in the kernel thinks that swap is actually free RAM and keeps more things open, stopping tasks from being killed at all. If you want to use swap, I recommend you use a donut/cupcake/hero rom that uses a different kernel so that things don't get down to a screeching halt. And anyways, the fastest speed I have ever seen my phone write something from my computer to the phone via USB is 2.7mb/s, compared with 6-12mb/s I get from an sdcard reader. That means that even when your phone is writing at top speed, it is just barely far from the 2mb/s write speed guaranteed by a class 2. You will definately see better performance with swap on a class 4, but anything higher won't benefit your phone much at all, unless you regularly transfer large amounts of files to your memery card via a card reader.
Click to expand...
Click to collapse
What if I have a task killer app? Because running out of RAM is just as bad as having too much running...I don't have many apps as I only keep what I actually use as well.
I have to ask, what are you seeing as the symptom of "running out of ram" the system will always use all ram so it will always have nearly none free.
By this I of course mean what is taking forever from you the end users perspective.. from there we can tweek in the right direction or work on making the phone prioritize what is needed to be useful.
Many times people put tons of swap only to find the the problem application is still removed from ram/swap due to configuration and the system is even slower with swap.
Also before enabling swap try the settings -> adw -> system -> system persistent is enabled. (Or equivalent on other launchers)
If you really want to try swap, it wont be fast but in very little amounts
ezterry said:
I have to ask, what are you seeing as the symptom of "running out of ram" the system will always use all ram so it will always have nearly none free.
By this I of course mean what is taking forever from you the end users perspective.. from there we can tweek in the right direction or work on making the phone prioritize what is needed to be useful.
Many times people put tons of swap only to find the the problem application is still removed from ram/swap due to configuration and the system is even slower with swap.
Also before enabling swap try the settings -> adw -> system -> system persistent is enabled. (Or equivalent on other launchers)
If you really want to try swap, it wont be fast but in very little amounts
Click to expand...
Click to collapse
Well, if I have MSN Talk open, the home screen tends to fall out of memory (Yeah, I have System persistent enabled) and Messaging is extremely slow (To the point where a letter appears a good second after I press the key), it's that kind of thing when I run certain programs, it makes it hard to have stuff like JuiceDefender running because I always run out of RAM even just running the Speedtest app then.
How hard would it be to change the Lag Fix to use a small 128Mb virtual RAM drive, rather than the internal SD?
this will solve the corruption seen often in many of the devices people have reported problem with during install, use, and dead internal SD, also avoid unnecessary partition changes which are usually the cause of some SD getting damaged in the process, and voiding the warranty.
in a way the RAM drive will work more very much like a swapspace/pagefile to cache the most recently used files and writing them back only if changes have been made
if it a new App that loads up needs more buffer/cache than it's available it'll write back all the stuff on the cache back to the physical SD to free up space for the new App being loaded.
Also apps that are too big for the 128MB RAM drive will be loaded directly into memory bypassing the RAM drive, and it will safe files directly back to Internal SD, the only times this are expected to happen are with Games, HD movies and such
this will keep the phone fast and responsive, meanwhile reducing the usage of the internal SD
ideally the size of the virtual RAM drive should be configurable to like 64 Mb, 128 Mb, 256 MB, or more (after froyo)
BTW... the goal of this is to help people getting into the situation of getting the internal SD corrupted
AllGamer said:
How hard would it be to change the Lag Fix to use a small 128Mb virtual RAM drive, rather than the internal SD?
this will solve the corruption seen often in many of the devices people have reported problem with during install, use, and dead internal SD, also avoid unnecessary partition changes which are usually the cause of some SD getting damaged in the process, and voiding the warranty.
in a way the RAM drive will work more very much like a swapspace/pagefile to cache the most recently used files and writing them back only if changes have been made
if it a new App that loads up needs more buffer/cache than it's available it'll write back all the stuff on the cache back to the physical SD to free up space for the new App being loaded.
Also apps that are too big for the 128MB RAM drive will be loaded directly into memory bypassing the RAM drive, and it will safe files directly back to Internal SD, the only times this are expected to happen are with Games, HD movies and such
this will keep the phone fast and responsive, meanwhile reducing the usage of the internal SD
ideally the size of the virtual RAM drive should be configurable to like 64 Mb, 128 Mb, 256 MB, or more (after froyo)
Click to expand...
Click to collapse
We already only have like 300mb ram total, with less than 200 free. With a 128mb ram drive, I don't think we'd have enough ram to really run more than 1 app! Plus loading apps into and out of the ram drive would be pretty slow, I think? Managing how to load-unload apps from the ramdrive sounds very very difficult too. You'd modify the dalvik system I guess? Wow, I have no idea how!
yes currently we only have a bit over 300 MB to use, and with a RAM drive it'll be even less, but once we move to Froyo we might be able to get full access to our 512 MB of RAM.
From PC experience even when you have little RAM (512MB Win9x, Win2000) a small RAM drive can still improve system performance drastically even when after mounting the RAM drive you have less RAM available.
Most apps in android even though they reside in memory they don't consume RAM/CPU cycle unless it's actively running in the background or foreground
this can be seen clearly in the stock Task Manager
so even though the amount of RAM is reduced, end users should theoretically be able to run several apps in memory and no experience any delay as only the active 3~5 tasks are swapping in the RAM drive then going back to idle.
in the old times Win9x/2K didn't have that, all the stuff kept running in the back-burner even when the software & services were idle, yet it still worked better with a RAM drive installed than working off the slow 5400 rpm hard drive swap (very similar to the problem with have with the RFS from Samsung vs. Ext2,3,4 FS from Linux)
the current methods that you are the other guys are using for the Lag Fix could work if we can tweak them some how to hold the space elsewhere (External SD), or as you said if we can add 2GB of RAM into the phone
this will give advantage to speed/cache buffer, and prevent wear on the External SD, and even if the External SD does dies, it can be easily replaced without having to send the phone back to Samsung to replace the internal SD.
Hello AllGamer!
Actually data is written to disc because it needs to, that's what differentiate "Ram" and "disk"
The better solution would be to determine exactly where the problem is, and if RFS is the problem, to work towards fixing the bottleneck in the RFS drivers (if possible).
If anyone could help me out here I will love you LONG time:
I am wondering id I should set up a swap partition and use it with this script (apps/data 2 ext, supports swap). I am starting fresh on my Nexus One installing a Gingerbread MIUI ROM using this script for the first time. I was wondering if I should use a SWAP with my class 4 16gig sd card. I will have a 1gb EXT partition. If anyone could state simple pros/cons I would MUCH appreciate it. I have heard good but mostly bad about swap on gingerbread saying that it is not needed and can cause bad.
Does the N1 really need SWAP with Gingerbread? I'm shaking in my pants posting this but I have not seen any related articles, let alone for the N1. I have done a Google search but that doesn't help, it confused me more if it is worth it.
Thanks again. Deuces.
There are some comments from experienced users here on swap, most are against. Here is a link that has a lot of comments--
http://zerocredibility.wordpress.com/2009/08/24/why-android-swap-doesnt-make-sense/
I am no android tech, but never used and don't have issues. I run a lot of apps over a hundred from the Market alone
Thanks! Exactly what I needed. No SWAP for me!
Glad to help--
I'm no expert either. But I do have a 256MB swap partition.
Swap *should* only be used when physical memory is low, and more is still needed by the system. If you're low on memory and need more, then swap might be useful then.
There's a kernel setting called "swappiness". I have this set to a low setting "5", which I believe means that swap should only be used as a last resort i.e. more importance is put on using physical memory over swap.
Yes swap is slower. If a system is swapping out, then it's logical to add more physical memory to the system. However as we cannot upgrade physical memory on our phones, so I suppose swap is the next best thing.
Anyhow that's just my personal thinking. My Nexus is running sweet and I don't notice any considerable slowdowns. However perhaps my swap has never really been required?!
Swap is made for desktop OS, where there is such thing as "lack of memory".
Such thing doesn't exist on Android, mobile OS of completely different design.
The reason is - desktop OS can't kill the tasks you've left running. Mobile OS can, and will, once it senses that it needs more memory. And the tasks themselves are built to be killed.
Adding SWAP is fooling Android that it has more actual memory than there really is - and the OS is using it like it was real memory, not killing tasks when it should. And while doing that, SWAP is far slower than just killing and reloading tasks - because it requires writing to and reading from the SWAP partition the whole app, while when killing and loading it, only reading is required - making the process MUCH faster.
I believe that's the essence of the earlier reference.
Shortly, unless there is severe lack of RAM (and on N1 there isn't by any parameters) - SWAP will make things worse, not better.
By activating compcache (~18% should do), and kernel samepage merging, there is no need for swap. I think texasice confirmed this, although I am not sure.
Sent from my Nexus One using Tapatalk
I would never use swap for GB. Tough there is discussion of using it on ICS, the few times I have tried it I did not use it.
I used swap a long time ago on CM6 or early 7 and there was absolutely no benefit in my opinion. Doesn't swap force more read/write times on SD which can decrease the life as well? That's just my $0.02.
TheAndroidStop said:
I used swap a long time ago on CM6 or early 7 and there was absolutely no benefit in my opinion. Doesn't swap force more read/write times on SD which can decrease the life as well? That's just my $0.02.
Click to expand...
Click to collapse
Swap isn't useful when it's not being used, and FroYo or Gingerbread hardly uses that much RAM. ICS, however, with its full hardware acceleration, is a real memory hog. Now, though, if we enable kernel samepage merging and a zram amount of like 18%, we wouldn't need a swap partition. Like it's been said before, swap is very slow, much slower than actual RAM.
Sent from my Nexus One using Tapatalk
Swap seems as use full as a taskiller in Android....
Sent from my Nexus One using xda premium
Hello, does not swap hard Android phone for auxiliary memory damage the hard?