Why I don't use a Swap Partition anymore - EVO 4G Q&A, Help & Troubleshooting

I am convinced it hurts more than helps on a phone with a decent amount of memory such as the Evo.
I'm also convinced anyone talking about how swap could improve things usually isn't talking about an Evo. Most of the gushing reports of swap nirvana I have come across were written years ago** when android phones were new and had very small amounts of RAM.
Basically, what it comes down to is this:
Android has ways of managing memory.
Tons of tweaks and scripts (eg task killers, v6, juwe, carodope et al) have tried to improve upon this.
If you add swap into the mix you have a mess. They fight each other.
In my experience it adds significant, experience-wrecking lag, even on a fast SD card.
And for what?
So you can occasionally run a large app (and on an Evo it would have to be *very* large), pop over to different app, and resume the original large app slightly faster than you could have using normal memory management techniques.
For me it's clearly not worth it. If you have had a great experience with swap on an Evo I'd love to hear about it.
** some background reading for those new to swap:
http://zerocredibility.wordpress.com/2009/08/24/why-android-swap-doesnt-make-sense/
http://wiki.cyanogenmod.com/wiki/Swap_and_Compcache
https://help.ubuntu.com/community/SwapFaq

What about if you would set swapiness real low like 0-10
Then only when the extra memory is absolutely needed it would be used. I find that even using tweaks like v6 smurf ropeadope jade etc only running fairly aggressive settings keeps things running smooth. Bad part is that it kills multitasking.
In my evo running memory settings that are fairly balanced keeping recent apps that I'm using in memory will result in the odd reeboot because of low memory. Not excessively so but I usually know when its coming. It depends on how much I'm using my phone too.
How big of a swap have you played with and what swapiness settings?

What memory monitoring tools do people use?
To answer your questions, I mostly used a 64 MB swap partition, and occasionally a swap file on the main SD card partition, but did not try a large swap file on the order of 256 or 512 MB.
I also experimented with swappiness values of 0 10 and 60.
I would periodically check the output of the "free" command to see if the swap partition was even being used.
Swappiness 10 rarely seemed to cause any paging at all. 60 showed a lot of usage, but also seemed to create a lot of lag.
I used Go Task Manager to look at memory usage. I would launch a lot of fat apps (the xda app is a huge memory hog for some reason) and see if switching between them was any better or worse than usual. I don't think I ever said to myself "this is noticeably better".
For whatever reason, I can't get Go Task Manager to ever report more than 300, maybe 305 MB of memory was being used, swap or no swap.
I noticed using swap does not show any more memory is "available". I think of a swap file as something akin to a windows pagefile. It used to be pretty easy to see when you were using a lot of virtual memory in Windows, but I'm not sure I am using the right tools to monitor performance on android.
One might think running a kernel that allows swap would allow the phone to behave as if it had more memory "available" (even if a performance hit was associated in accessing the extra "memory"). I guess either this assumption is incorrect, or (my personal suspicion) other memory management strategies are baked in to my current ROM+kernel combo that already monitor memory usage and usually step in and kill things before memory usage ever gets above a certain level.

Related

does android experience "memory leaks" like windows?

I have experienced this with a previous android phone and the evo is acting the same way. I boot the phone up and wait for everything to load up and the system to settle down. Then i use a task killer to unload all the programs that insist on loading at startup. I will get like around 250mb of free memory. The longer the phone runs, the less memory I have available to use even after using a task killer later too. I've seen it go down to like the 180mb mark. A reboot fixes this. Can someone explain what is going on here?
Although it's possible, I'd personally say it's highly unlikely you're getting a memory leak outside of the application level. The linux kernel is fairly mature on this architecture and rather robust.
I don't know if it's still doing this (since it's a flash-based device and may not keep up the same kinds of caches as it would for a desktop), but generally linux reports memory used for caching as "in use". This memory isn't always being actively used, and is instead to keep things running fast if you were to re-use some portion of memory you accessed before. As soon as the memory is needed, the kernel gives it up to the program that wants it. It's normal for a linux computer to run with very little memory "free" as reported by task managers but to actually have a lot of memory that _can_ be free, if needed.
AFAIK, windows reports caches as "free" or doesn't keep caches nearly as large, and that is why it tends to free up more memory when closing applications on that system (both NT kernels and CE, I'd assume).
Basically - it's probably just cache to speed up your device. Besides, it doesn't seem like you're running low on RAM to start with
Ok. From what I gathered, it's kinda similar to windows but it's done a different way. If I understood your explanation, even though said task manager is telling you that you have x amount of free ram, its not necessarily all you have at your disposal. The os is holding or using some ram for it's purposes. If the computer is really running out of ram, then the system will release some that is reserved for whatever for the system to use. I guess they (linux programmers) are going about things differently than other os do. I'm probably trying to visualize this with a windows mentality and it's done differently than that. With the amount of free memory I have, even after having days of time, I don't need to worry about running out of RAM. Am I following you correctly?

Low memory help!

I am fully rooted and running toasted delight beta 2 rom. I like to use a task manager and kill my programs every hour or so. How ever my free memory was about 170 or so. Now its 70mbs. What do I do other than restart my phone?
from my evo son!
In my opinion, I wouldn't worry about it. Task killers do not even seem necessary unless you are getting FC's or very bad performance because of a lack of memory (it would have to be at 30MB or less to reach a critical level)
Android memory management can usually do a pretty good job handling all the applications you have open, if memory runs low it begins a procedure of terminating the app's you have not used in a while, freeing up more space for newly opened apps (you can think about it like a stack really)
Android also performs something along the lines of pre-loading commonly used apps into memory. Even if you are not using the app, if it is commonly used then it can get partially loaded into memory. Thus, if you use an app killer to kill off an app or service, if you commonly use the app then android may still be loading it into memory (and therefore it will bring your total memory down).
anyone with corrections please do
having unused memory = worthless. In fact, I use a memory management prog to set any custom rom back to default memory management settings (off the top of my head something like 24mb of unused memory left is when it goes in to action).
I think this is a windows vs linux type thinking... I've noticed that, ever since I switched to linux I've gotten used to the fact that my OS is prepping things for the future (i.e. preloading stuff into memory that it thinks I will need). In the end it makes the system much snappier.

[Q] Why no ones talk about the lag cause by Insufficient memory

I notice the phone start lagging when there are less than 100Meg of available RAM on both 2.1 or 2.2 SGS.
Questions....
1. How do i make sure there will always be min 130 available when not in use?
I'm currently using Froyo Task Manager, ATK and SystemPanel together to make that happen manually. A better suggestion or use of them will be appreciated.
I also tried MemoryPlus and Taskkiller (The red android logo)
2. There are so many background service running some of them start with com.samsung.... (what are these?) do we need them?
3. Why some Apps always run without us telling them to run, or ask us to give them to permission to run on background at will?
ATK
In ATK in settings you have auto kill level, which is disabled on default.
jakaka said:
In ATK in settings you have auto kill level, which is disabled on default.
Click to expand...
Click to collapse
I'm using JPC, ATK autokill will not able to kill at a system level like SystemPanel, so after a day of active use, the memory will still continue to reduce as some of the background service start consuming more and more memory or run more background process. E.g. Touchwiz from 17 Meg to 25 Meg.
So at the start with ATK, i will have 130Meg, after a day of active use i left with 80Meg. With Apps killed.
I use autokiller set to aggressive. memory left 152mb
ivanchin99 said:
I use autokiller set to aggressive. memory left 152mb
Click to expand...
Click to collapse
Cool, does that remain for few days? How often do you restart your phone?
free memory is bad memory!
why don't let android do it's job?! this ist linux with a clever memory management, not windows 95!!! deinstall all auto task killer android is handling the memory very well. it uses all it can get and if it's not enough it kills old uses apps from it. why have free memory, there is absolutely no reson for that! ram is fast, let the often used apps be there not on slow sd or nand!
Mykron said:
free memory is bad memory!
why don't let android do it's job?! this ist linux with a clever memory management, not windows 95!!! deinstall all auto task killer android is handling the memory very well. it uses all it can get and if it's not enough it kills old uses apps from it. why have free memory, there is absolutely no reson for that! ram is fast, let the often used apps be there not on slow sd or nand!
Click to expand...
Click to collapse
QFT!
What is the point of having memory if it is constantly empty?
Think about it this way...If you had five friends at your house and you have five chairs, do you make 2 or 3 of your friends stand so there is always empty space or do you let everyone sit down and worry about something worthwhile?
Finguz said:
QFT!
What is the point of having memory if it is constantly empty?
Think about it this way...If you had five friends at your house and you have five chairs, do you make 2 or 3 of your friends stand so there is always empty space or do you let everyone sit down and worry about something worthwhile?
Click to expand...
Click to collapse
True, upto a certain point... I don't think you need to have at least 100 or 150 mb free but it DOES seem to help to not let it get down to like 30mb...
For me:
-JM7
-animations off
-voodoo lag fix
-minfree manager set to preset agressive.
minfree manager customizes the android memory management system.
I love it this way, No lags when starting the Phone (DIALER) or anything else. The dialer annoys me the must, this must be lag free, if i want to dial i want to dial right away.
Btw, I think you have made some wrong assumptions about the Android memory management system, as mentioned, unused ram is wasted ram.
dagrim1 said:
True, upto a certain point... I don't think you need to have at least 100 or 150 mb free but it DOES seem to help to not let it get down to like 30mb...
Click to expand...
Click to collapse
Agreed but I have never seen my Galaxy with free memory that low and I don't use a task killer. Of course I don't often have more than 3 or 4 apps running at the same time
This is not about letting ram do nothing.you surely don't wasn't your ram get used up by programs you don't want while you had no hand in this.All those services running I don't want.badly written programs that are hanging out in memory instead of closing.at least in symbian an app closed when you exited.
Why would you have 100MB free ? Do you have any application that needs 100MB to run ?! The android system already has enough memory to run so even if you could have 200MB of free memory you phone wouldn't run any faster you would just be able to lauch around 20 apps at the same time.
Read this:
http://geekfor.me/faq/you-shouldnt-be-using-a-task-killer-with-android/
Linux however isn’t generally affected by this. While I admit that I don’t know the architecture and reason for this… linux will run the same regardless of if you have 20mb free memory or 200mb.
Click to expand...
Click to collapse
Finguz said:
Agreed but I have never seen my Galaxy with free memory that low and I don't use a task killer. Of course I don't often have more than 3 or 4 apps running at the same time
Click to expand...
Click to collapse
Dunno, I just noticed that one time my phone was VERY sluggish and memory free was around 20mb or so. Cleaning it up did seem to help (unless one of the programs killed was causing the lag of course).
Ah well... Whatever people choose right?
You guys can argue all you want that free RAM is a waste of RAM....
But it is a fact that the SGS runs much slower when the free RAM is low. This is the experience of all the SGS'es I have tried and my own as well. At least this is the case when running 2.1. I have not tested anyone with 2.2 yet.
It s starts to lag when memory is below 40 mb. So when it s low and you start an application it starts to lag. I set it to 50-55-60 and got hardly any lag. No need to keep so much free ram
Sent from my GT-I9000 using XDA App
matty___ said:
It s starts to lag when memory is below 40 mb. So when it s low and you start an application it starts to lag. I set it to 50-55-60 and got hardly any lag. No need to keep so much free ram
Sent from my GT-I9000 using XDA App
Click to expand...
Click to collapse
Which ROM are you using? as the low memory killer level for background apps is set at 40M which means you should have 40M free all the time or it will start killing background apps. This is also why task killers are useless, free ram is wasted ram for android.
I never had the experience that more free RAM is faster, perhaps with the stock rom but JC and upwards are all good by default. Animations off + Oneclick lagfix (or another) and the phone stays totally lag free.
Being an android user for 1,5 years now i'm very confident Taskkillers are useless except when an app is stuck. I've had periods where I used them allot but the phone only gets slower as the killed apps have to be loaded into the memory again.
Finguz said:
QFT!
What is the point of having memory if it is constantly empty?
Think about it this way...If you had five friends at your house and you have five chairs, do you make 2 or 3 of your friends stand so there is always empty space or do you let everyone sit down and worry about something worthwhile?
Click to expand...
Click to collapse
Provided you are not expecting anymore friends. The problem happens if all your 5 friends are happily seated and along comes 2 more friends a-visiting. So you have to now move 2 inactive (for want of a better word) friends out of the seats so that you can accommodate the 2 new ones. This takes time. So why not move these friends out as soon as they become inactive so that the space is readily available when someone comes calling?
Try to have a read about garbage collector before argueing about free memory.
The more you try to have a large amount of memory, the more you will need major GC (and during major GC all activity is frozen).
If you let the system manage memory, it does minor GC as needed when it reaches min memory waterline (seems to be 50Mo on SGS).
Let the system do its job.
Get rid of task killer.
Mykron said:
free memory is bad memory!
why don't let android do it's job?! this ist linux with a clever memory management, not windows 95!!! deinstall all auto task killer android is handling the memory very well. it uses all it can get and if it's not enough it kills old uses apps from it. why have free memory, there is absolutely no reason for that! ram is fast, let the often used apps be there not on slow sd or nand!
Click to expand...
Click to collapse
I completely disagree. OK, it is better to use memory, but the android memory management is extremely inefficient since it does not know which foreground and background processes are important to the user and which are not, even though it tries to figure that out. Since the Galaxy S does not allow the system to use the full 512MB of memory, this can be a critical factor. And the Galaxy S definitely lags massively when less then 70 or so MB of free RAM is available this is definitely a fact.
The biggest problem is that you cannot manually close apps and only have multitasking access to the last 6 apps used. If you use 7 apps simultaneously, the 1st app still consumes memory but you cannot even switch back to it. And there are so many useless background processes, starting up over and over again and consuming hundreds of MB memory if they are not killed in regular fashion.
Who needs gesture search, amazon mp3, layar, and all the samsung crap running in the background all the time. If you only have 10 such applications and each of them only consumes 15MB of ram, 150MB are wasted for nothing.
Every second market application registers itself as autostart on every boot, so to use a autostart manager is also mandatory.
Since everybody can easily develop for Android the application quality and resource efficiency is not always perfect. So in my opinion Android needs a task manager, this is why even Samsung integrates such a application.
Using a well configured ATK (set to ignore system applications, widgets and apps frequently used for multitasking and killing every else on screen off) and autokiller (strict setting) in addition to Autostart Manager (had to remove 40!!! useless apps from automatic startup) and lagfix, the SGS runs perfectly smooth.

[Q] Swap/Swappiness, what is it? How to use it?

Hi everyone,
I am wondering if it's possible to enable this on our EVOs and also what sort of effects would it create? From inside the "A2SDGUI" app (from dta2sd) it isn't possible for me to activate swap under "swap settings" even if I currently have my SD card partitioned with 128 megabytes in a swap partition.
Could we follow the instructions found in the link below (on post #2)?
http://forum.xda-developers.com/showthread.php?t=1349694
Physical memory can be extended using a swap partition. So when your phone (or system) starts to run low on memory, it moves some of the inactive processes into the virtual memory. [1]
[1]http://zerocredibility.wordpress.com/2009/08/24/why-android-swap-doesnt-make-sense/
Swap is, in short, virtual RAM. With swap, a small portion of the hard drive is set aside and used like RAM. The computer will attempt to keep as much information as possible in RAM until the RAM is full. At that point, the computer will begin moving inactive blocks of memory (called pages) to the hard disk, freeing up RAM for active processes. If one of the pages on the hard disk needs to be accessed again, it will be moved back into RAM, and a different inactive page in RAM will be moved onto the hard disk ('swapped'). The trade off is disks and SD cards are considerably slower than physical RAM, so when something needs to be swapped, there is a noticeable performance hit.
Unlike traditional swap, Android's Memory Manager kills inactive processes to free up memory. Android signals to the process, then the process will usually write out a small bit of specific information about its state (for example, Google Maps may write out the map view coordinates; Browser might write the URL of the page being viewed) and then the process exits. When you next access that application, it is restarted: the application is loaded from storage, and retrieves the state information that it saved when it last closed. In some applications, this makes it seem as if the application never closed at all. This is not much different from traditional swap, except that Android apps are specially programed to write out very specific information, making Android's Memory Manager more efficient that swap.
This question is hotly debated, but you almost definitely do not need swap. The only exception to this may be if the device is a first generation device (i.e. HTC Dream or HTC Magic).
Swap can give more available memory, however, class 6 SD cards are recommended and SD write wear is increased.
Actual performance depends on user memory use; you'll only see a benefit if you're consistently using up all available memory, due to any combination of inherently low device RAM, using multiple apps simultaneously, or a singularly memory-intensive app. Otherwise, the performance hit will exceed any performance gain.
How can I tell if swap/compcache is running?Go to the terminal emulator - or open adb shell - and run 'free'.
If it looks like this (with zeros in the swap line), you do not have swap
total used free shared buffers
Mem: 97932 96640 1292 0 272
Swap: 0 0 0
Total: 97932 96640 1292
Alot of the present roms floating around right now,don't use the swap partition,but its a good idea to leave something like 1GB or less for future swap initiation.
Thanks for taking the time to break this down. I was wondering myself if swap would be of any practical use. This is by far the best explanation I've seen so far.
Sent from my PC36100 using xda premium
I use a small swap partition(48mb) using swapper activator for when I'm playing certain games and need other apps to stay where I left em when I switch back
We are legion, for we are many.
Will ram expander help my infuse 4g play games better?
Sent from my SGH-I997 using Tapatalk 4 Beta
best explanation so far:good::good:

[Q] Excessive RAM Usage?

Hi Folks,
I've got the ZE551ML 2.3Ghz/4GB RAM/ 64GB ROM/ USA Version.
I picked up this phone mainly because of the 4GB RAM- I'm sure many of you did the same.
I multitask a lot and would rather not have to quit/close apps and let the memory management handle that.
I've noticed that the default RAM use by the phone (immediately after bootup), is TOO high (about 2GB used), with no background apps but a few background processes running (your FB/ Messenger/ Whatsapp/ Twitter - not too many, just these).
Have noticed that opening several 'light' apps (non- CPU/GPU/RAM intensive apps, fills up the RAM usage significantly). Last night, with less than 50MB free RAM left, the phone froze up and re-booted. This is a sign of very bad coding. Shouldn't the OS be able to kill tasks that have not been recently run to free up RAM?
Do any of you face similar issues? What are your workarounds? I'm aware that ZenUI is extremely RAM intensive itself.
P.S I am aware of 'Memory Leaking Issues'
I get the same. It starts using around 2GB. I had also noticed some apps, like WhatsApp/Snapchat growing to consume 4-500MB over time. That said, it has never froze up on me. I didn't notice Zen UI taking up a lot of RAM at any point, but I started using Nova pretty early on and have frozen most of the ASUS/Zen stuff through Titanium. I'd suggest you root it, if you haven't already, and start freezing out apps you don't use/prevent apps from auto-starting. That helps a lot.
Even leaving 2GB to start with, that's a ton of RAM for multi-tasking, unless you're using especially RAM-intensive apps (aside from the leaking issue). As for a fix, I'm not aware of any yet. We're all pretty much waiting for a new update so we get 5.1.x, where the leak is fixed. Even better, waiting for an AOSP/CM ROM to be released so we can be done with this ASUS stuff to begin with. IIRC there is an Xposed module for the memory leak issue, but last I read it wasn't working (for this device at least).
There must have been some optimizations made with the most recent two updates because the apps I noticed issues with before aren't consuming anywhere near as much RAM as before. WhatsApp/Snapchat are currently using ~220MB combined, whereas before it could get close to 1GB.
Thanks for the Reply.
I'd love to Root the device but unfortunately with corporate email and Mobile-Iron, this is an impossibility. (Consequently even Mobile Iron hogs a portion of the RAM).
Considering that a lot of devices even being released at the moment have 2GB RAM and this is allocated to System resources as well as back-grounded apps. How do those companies manage the memory in half the RAM as the ZF2 (considering they would also face similar memory leak issues)
If you are thinking of RAM usage from a Windows user's perspective, you might be feeling this way. There is no harm in RAM being used. In fact Linux or Android loves caches so much that they fill it up most of the time. And since we have 4GB, why not fill up about 3GB? If a device has lower memory altogether, say 1GB, it will only fill up about 700MB. But of course the memory leaks in 5.0 cause major irregularities.
Bottom line is RAM hogging isn't really an "issue" as far as i am concerned. The issue would be if the RAM does not get released for important tasks and the device starts to lag. But I don't see this happening, so why complain right? However this is just my opinion.
after updating to 2.19.40 my phone also started to consume a lot of ram .....even goes to 645 mb free sometimes
That's perfectly fine. Free RAM is wasted RAM. The OS wants to keep about 500MB or more free because beyond that you do experience slowdown. Above that, it's all gravy.
The system generously allocates that much RAM to itself because it can and to ensure core processes and ZenUI don't slow down. Android caches aggressively so switching between apps will be faster.
Auto-start Manager and Clean Master app, can help free up RAM
Sincerely,
ASUS_USA

Categories

Resources