does android experience "memory leaks" like windows? - EVO 4G Q&A, Help & Troubleshooting

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?

Related

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.

Why I don't use a Swap Partition anymore

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.

Using a lot of RAM... for some reason?

Ok so I was running an app to check on CPU speeds (unrelated research) when I noticed that this same app was saying I only had 340mb of RAM free...
This seemed a bit strange, considering this tablet has 3GB of RAM on board, and I'm not really running anything at the moment.
I went into the storage setting page, and looked at running processes, and it says that I am using 2.5GB of my RAM.
but... if I add up all the ram usage on all the running processes, it only adds up to about 500mb....
So what is using up the other 2gb?
If anyone has any suggestions, it'd be nice, as at the moment it seems I only have 1gb of usable RAM in this device...
EDIT:
Nevermind, I think I solved it... sort of. I found that the ram clearing button is in a different place than I remember, and I have managed to clear out some more space... though even after a full reset 1.5gb of ram is immediately being used. Seems a lot.
Though this is a stock rom etc so I suspect thats normal.
electrical tcfpain
nirurin said:
Ok so I was running an app to check on CPU speeds (unrelated research) when I noticed that this same app was saying I only had 340mb of RAM free...
This seemed a bit strange, considering this tablet has 3GB of RAM on board, and I'm not really running anything at the moment.
I went into the storage setting page, and looked at running processes, and it says that I am using 2.5GB of my RAM.
but... if I add up all the ram usage on all the running processes, it only adds up to about 500mb....
So what is using up the other 2gb?
If anyone has any suggestions, it'd be nice, as at the moment it seems I only have 1gb of usable RAM in this device...
EDIT:
Nevermind, I think I solved it... sort of. I found that the ram clearing button is in a different place than I remember, and I have managed to clear out some more space... though even after a full reset 1.5gb of ram is immediately being used. Seems a lot.
Though this is a stock rom etc so I suspect thats normal.
Click to expand...
Click to collapse
You probably aren't using all 2.5GB for actual running programs.
Windows 7 does a great job of managing money. If it has any unused memory it will hold often used programs or data in memory in case it's needed. If a running program needs that memory it's quickly shifted. Otherwise when you reopen that program you recently closed, it may load quickly from memory rather than from the drive. I suspect Android does things similar.
Modern systems programmers consider "free" memory to be wasted, so they put it to the best use they can anticipate. That gives you the benefit of all memory as often as possible. If they only allowed the memory to be used for what's needed right now, your Note would only have about 1 GB memory, and would be considerably slower.
It's a little like having the cook wash your car while waiting three hours for the turkey to cook. You get both the turkey and the car wash.
jnichols2 said:
You probably aren't using all 2.5GB for actual running programs.
Windows 7 does a great job of managing money. If it has any unused memory it will hold often used programs or data in memory in case it's needed. If a running program needs that memory it's quickly shifted. Otherwise when you reopen that program you recently closed, it may load quickly from memory rather than from the drive. I suspect Android does things similar.
Modern systems programmers consider "free" memory to be wasted, so they put it to the best use they can anticipate. That gives you the benefit of all memory as often as possible. If they only allowed the memory to be used for what's needed right now, your Note would only have about 1 GB memory, and would be considerably slower.
It's a little like having the cook wash your car while waiting three hours for the turkey to cook. You get both the turkey and the car wash.
Click to expand...
Click to collapse
I'm guessing you mean android, not windows 7
Though I imagine both do the same thing lol
nirurin said:
I'm guessing you mean android, not windows 7
Though I imagine both do the same thing lol
Click to expand...
Click to collapse
I used Windows 7 as an example because I know how it works. Like you, I imagine Android 4.3 does the same thing.
I was wondering about this as well. On my Note 2, when I clean the ram, it will go to 480-500 / 1.75g on this tab, ext I could get is 1.33/2.75.......
I went through and turned off a lot of the apps, it helped free up a little bit.
Does anyone have a list of the apps that are safe to turn off?
:beer:
Sent from my SM-P600 using Xparent Cyan Tapatalk 2
I have LTE version with Snapdragon and when I start the tablet, it uses about 890MB of 2,35GB available (yes, it has 3GB RAM, but graphic processor uses some of this RAM)... When it loads all apps to RAM (about 50 of them, we know android do this) and I start few apps(FB, Gmail, Chrome, Hangouts for example), I still use only about 1,3GB of RAM... So almost 1GB is still free
In Android having too much free ram is not a good thing. Let your apps use it, you don't have to worry about not having enough ram, OS manages it well for you.
ddavtian said:
In Android having too much free ram is not a good thing. Let your apps use it, you don't have to worry about not having enough ram, OS manages it well for you.
Click to expand...
Click to collapse
+1
Android is a mobile OS which means that it can backup and restore not needed apps if necessary and the 3GB are only the runtime memory beside this it can use the whole internal memory for "running" apps. So long Android got enough memory it holds all apps in memory which speed up the whole device. Therefore it is positive that the Note use his whole 3GB memory and don't think that killing apps or free memory will be a good idea. It will slow your device and produce lags.
ddavtian said:
In Android having too much free ram is not a good thing. Let your apps use it, you don't have to worry about not having enough ram, OS manages it well for you.
Click to expand...
Click to collapse
Elim said:
+1
Android is a mobile OS which means that it can backup and restore not needed apps if necessary and the 3GB are only the runtime memory beside this it can use the whole internal memory for "running" apps. So long Android got enough memory it holds all apps in memory which speed up the whole device. Therefore it is positive that the Note use his whole 3GB memory and don't think that killing apps or free memory will be a good idea. It will slow your device and produce lags.
Click to expand...
Click to collapse
They are both right. Android is based on linux. Linux uses ram very effectively to cache apps and data to speed up your system. When something needs ram it removes a different app or data from the ram to keep moving. It works totally different from Windows. Check out this article.
http://www.androidcentral.com/ram-what-it-how-its-used-and-why-you-shouldnt-care
Every day since Android came out someone asks this question somewhere... Is Google offline?
Sent from my SM-P605 using XDA Premium HD app
If you want to change how your ram is managed, and you have root, you can use the v6 supercharger or a simple minfree setting app. V6 is in the developer section of the general android forum on this site. I've found that m ram fills up from cached apps. V6 will let you auto clear however often you want.

[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