*RANT* bad Android memory management - General Topics

Guys I have problem with Android smartphones. I am not the youngest anymore and remember the first PCs and first smartphones with 32x less memory then an average handheld device has today. I played with them all and know what they could do. The thing that still continues to surprise me till today on Android is WHY the heck can't an app stay in memory without being quit on the first occasion?? I really think that Android will never be usable for any serious work if things keep closing or reloading just after a few switches between apps!
Some examples: why can't I switch between Chrome browser and Onenote to type something without having that webpage be reloaded again using more data and sucking more battery power? I learned not to risk writing any bigger post into some forum lately because if I would have to switch to another tab to check some info or switch to another app the in progress text would most likely be lost because webpage would reload! Why is it so risky to switch out of some game to write a message or check calendar because it is very likely to be killed and my progress lost? The phones I used recently (Xiaomi Mi2s, Xperia Z3 compact, Xperia Z5 compact) have frikin 2GB of memory, so I wonder if nowadays apps are so much more memory demanding then before that this is simply still not sufficient. I just checked settings and some apps I just tested use few tens of MB, so it is still comparable to the times of Windows 98 or Windows mobile IMHO.
My first smartphone was windows mobile Samsung Omnia II with just around 90MB of usable memory and let me tell you that this problem was not happening on it! I could have several tabs with webpages (even non mobile versions) open and could safely switch on the camera, take pictures, write an sms and go back without having to worry that anything will be closed or reloaded! Why can't I open a camera app on Android and take a photo without having the previously open app be closed?
I can even compare today's android phones to one of my oldest pcs back in year 2000 or so. Imagine that it had just 64MB of RAM. I could have open many webpages in Internet Explorer (yeah it was far the best at that time , a few editors for web and text editing and I could even play some game and alt+tab back and forth without any problem! That was Windows 98 guys. Of course you will tell me that today's web pages for example are much bigger then in 2000. OK but what about mobile versions huh? I don't think they are that big so a phone with 2GB of RAM would choke.
I always thought that apps are supposed to be paused/frozen when I switch out of them but left in memory. Unfortunately it seems apps are being killed surprisingly often even when settings / memory shows hundreds of RAM free. The thing that is even more weird to me is that apps I had open just a few seconds ago are being closed upon switching to some other one and back, but the ones which I had active hours ago often stay in memory! That does not make much sense. Why doesn't android kill the longest not active apps first instead? OK, so do I have to buy OnePlus 3 or Meizu Pro 6 with 6GB of RAM to be able to keep simple 3 apps open without worrying that they will reload when switching out of them? As I showed this does not happen on much older devices with similar specs, so is this some fundamental flaw/feature of Android architecture or am I missing some simple explanation?
If you have experience with Windows Phones or iOS regarding this please share and compare.

So it seems everybody agrees
But I would really like to know some of your experience with other phones from the fruit company for example...

java
---------- Post added at 07:20 PM ---------- Previous post was at 07:11 PM ----------
> Why doesn't android kill the longest not active apps first instead?
There is some heuristic going on that calculate the oom priority and modifies /proc/PID/oom_adj so. For example (foreground) services have lower oom_adj (less likely to be killed by oom-killer). Actually I ended up adding code to my app that overrides /proc/PID/oom_adj to a really low number to keep it running (but that requires root - I also dont understand why *the user* does not have a chance to say "hey android keep running this app in the background!")
> Unfortunately it seems apps are being killed surprisingly often even when settings / memory shows hundreds of RAM free
Yeah that "low memory value" (ie when to kick off the oom-killer) is also set somewhere in /proc (?) It's 200MB on my phone with 2 gigs ram IIRC. To test what's getting killed (and whenl, etc.) this app is superb: https://play.google.com/store/apps/details?id=com.tspoon.androidtoolbelt
it's all even more annoying because starting even basic apps (like dialer or contacts etc. etc.) takes even seconds(!) if they are not in memory already (on any phone!) ... oh, well, java

Thanks for a reply! Have anybody tried MIUI? There is an option to lock an application and supposedly prevent it from being killed when multitasking. Just swipe up in tasks view and it marks it with a lock. I have just read this article and it seems manufacturers set these LMK values. I have a feeling they are really high for Sony phones. Maybe if I root mine I would be able to change those. Unfortunately it seems without root I cannot even view these values. They show as 0 in /sys/module/lowmemorykiller/parameters/ and cannot be opened. I can't open those oom files either.

yeah, defo need root for this

Oh and it gets worse. Because of this behaviour many apps use a nasty trick of setting up an alarm (usually with wake lock) triggered every second to make sure they are running (if a process is not running and there is an alarm for that process set up, the process is started).
So what happens is that the OOM/low-memory killer kills the app it is started by android framework the next second ... and it might get killed by oom-kiler again ...
It's interesting to run "apktool d foobar.apk" and grep the smali for "AlarmManager.set" on apps that want to run in the background ...

CleanMaster app is good and it saved me from exhausted internal capacity issues many times (on Z3Compact) and it also shows apps which frequently restart. Is that because of what you just wrote? I remember it was Pinterest a lot for example.

and it also shows apps which frequently restart. Is that because of what you just wrote? I remember it was Pinterest a lot for example.
Click to expand...
Click to collapse
sounds like it could be the case but you it's hard to tell for sure - you would have to have a look at logcat at least

I have logcat. What would you search for there?

Related

Raphael is brutally closing programs!

Raphael is brutally closing programs!
I really dunno why is this happening... I have 50% of RAM free and it lets me run just 3-4 programs together. When I run one more... it occasionally selects one thats previously ran and kills it silently... I really wouldn't like to "Clear Storage" from settings
I also had this problem when I first got my TP. It's a simple fix - you need to disable AutoKill. With a registry editor, go to HKCU\Software\HTC\TaskManager, and change the value of “EnableAutoKill” to “0".
^ yes this a good fix. I remember I couldnt switch between opera and replying to a text message, I felt like I was back to a feature phone, with one thing at a time capability.
There is also a registry tweak that instead of killing apps you can change the threshold at which the system starts auto-killing, same registry path.
You guys are amazing! THANK YOU! BUT... I still have the problem
Any other ideas?
You can refer to this thread:
http://forum.xda-developers.com/showthread.php?t=426585
In the section of "Tips", there is a tweak which solved the problem perfectly
Thank you. Tried that caches tweak, it made whole system run much faster. But still - i cannot seem to get 4 proggies to run at the same time. Always the first dies... flip flop
This thread is turning into a copy of few others around here. Only this is new and alive.
Please help me out.
I've tried:
1) The HTC Task Manager registry tweaks
2) The cache sizes maximizing
and...
3)?
Maybe the ugly 32MB/32Process limit (http://msmobiles.com/F/viewtopic.php?p=36334&highlight=&sid=c6b5982e059ec35ce19fd3cd952bd683) is still present in WinMo6.1?
Hello!
OMFG! After disabling autokill my TP started to act almost like desktop in case of multitasking
I was able to run around 12 programs at a time, but i've also made changes to memorytreshold, the value i set was 173015040 (1.5 times the default value).
The funny thing was that TP was still responsive to commands and even opera ran smoothly when surfing throu light web pages.
First app closed after memory usage peeked around 65%, but the rest was still responsive.
Hope this helps
BHole
Thats my point. Same limit like 65% because I have customized my device with launchers, hardkey remapper, Wktask etc. Now I can have (only) five apps running at a time... Is there a sort of free RAM threshold inside the WM6 or HTC-s stock (1.9) ROM. Maybe it is still the 32 process limit from the old times?
Hello!
It looks like there is some kind of limit to number of proceses or memory used by them but if you customized your pda maybe you should disable some of the oryginal programs that are runing in the background. I saw some registry entries in taks manager that hid some of the runing aps maybe not all of them are nesesery for you and can be disabled to lower proces count.
BHole
Yeah.. but I would like to USE the RAM the device has.... I'd like to run manymany programs so the RAM load would be for example 95%. Why is not that possible?

G1 Startup Manager

Running Applications
Hi, im considerably new to the whole android development i have a g1 since early december and have upgrade it to the modded JFC 1.31 ADP. I also have the adp spl i think thats what u call it .
My question relates to the running processes/tasks/programs. I am concerned about the amount of programs that run in the background. Is there a way to cut down on this?
I have already removed Calendar, Amazon, Calculator, Calendar Provider seeing as how i do not intend on using these as for calculator i have installed a scientific calculator.
Its more or less Facebook, Craigslist, Imeem. The other bckg progs Gmail, Messaging, Alarm Clock are all smth i use so therefore i have no issue on that but ive tried editing settings on Craigslist, Facebook, Imeem and others to change the update interval and have maxed those out but still tend to run in the background i use the programs but i dont need them to update themselves.
Edit: I have also stopped the auto sync on Calendar, Gmail, Contacts Seeing as for Calendar i dont need it, Gmail i check it often, Contacts i dont use on my gmail service.
Have you got the task manager app from the app store? Thats what I do, and kill all the apps I don't need active.
TimSykes said:
Have you got the task manager app from the app store? Thats what I do, and kill all the apps I don't need active.
Click to expand...
Click to collapse
Yes i have, however they keep coming back up!
yeah I know some of them do. to me I don't know why alarm does. I don't even have a alarm set on my phone.
They come back due to the way android handles and saves tasks. The OS will keep resurrecting them thinking they are just dormant and were axed by them.
ArronL said:
They come back due to the way android handles and saves tasks. The OS will keep resurrecting them thinking they are just dormant and were axed by them.
Click to expand...
Click to collapse
So is there a way around this or not?
yeah.. im having the same problem, i shut them all down via task manager, but after like 1 minute i go back in there and they all come back up, is there any way to make them be off permanentally till you use them again?
tbh, the way the android works, if it keeps bringing these programs back they're probably not eating up too much memory.
in fact, no matter how much crap is running in the background i've never experienced any lag or anything. makes me wonder if there's any point in killing apps, except for ones that may be constantly connected to the internet.
Meltus said:
tbh, the way the android works, if it keeps bringing these programs back they're probably not eating up too much memory.
in fact, no matter how much crap is running in the background i've never experienced any lag or anything. makes me wonder if there's any point in killing apps, except for ones that may be constantly connected to the internet.
Click to expand...
Click to collapse
Well i definitely notice a lag, although i agree with you on the applications i removed like 80% of them now just using ones i need and just installed the 1.41 everything works great. But run about 10apps let them run in the bckgs and slide the main application tab on the home screen up and down and scroll through the programs. Then kill about all apps but 3 to account for ones you need and try it again you should most likely notice a difference.
Not on lag but background processes use up battery to, I did a wipe and have like four apps on my phone: aim astro any cut and ak notepad (wow must like A's) but my battery life is noticible better than before, I can go a whole day with out having to charge vs having to charge every few hours
does anyone know of a startup manager for the G1 for EG when i reboot or start up my phone i get a lot of services and programs which i use but do not want to start on boot.
i can use task manager to close them once the phone is started but wouldt be happy for something that disables these from the start.
Has anyone found a way to modify what OEM apps boot at startup?
So using Task Manager for Root Users we get this peek into what's ?running? on our phone. or am i sadly confused..
upon initial boot and after letting the phone boot fully (about 3 minutes) i get this list in my taskmanager..
Task Manager ---not oem
Service Viewer ---not oem
MyFaves storage
Messaging
Voice Dialer
Google Talk
Maps
Calendar
Alarm Clock
Power Manager ---not oem
Missed Call ---not oem
Messaging
Phone Recorder ---not oem
MyFaves Storage
Voice Dialer
Google Talk
Maps
The list remains the same even after several refreshes..
...oddly only after killing a few tasks this is added?
Gmail
note: at this point in service viewer/tasks, only taskmanager, launcher and service viewer are present..
After killing every process through multiple refreshes messaging (which I assume is a critical app tied to the notification bar) is the only thing that remains until i load something else..
First question..are the apps listed in task manager actual hurting my battery/memory/cpu performance?
Secone question..Is there any way to auto-kill these tasks upon boot, other than by removing them? Or is there some boot.ini type file that could be editted?
sry for the long post, just curious if something can be done...
Yeah id also like to know how to manipulate what starts up on boot.
Any dev should be able to tell us.
Plenty of apps start at boot.
Seriously I would LOVE the answer to these questions. Thanks
Now while this isn't coming from a dev, when I look at the running app list I often see things I haven't touched, but they won't start unless the phone's been idle. I think what happens is it actively fills empty ram with programs so they will start faster, so I think it's just in the nature of Android.
Fushichou said:
Now while this isn't coming from a dev, when I look at the running app list I often see things I haven't touched, but they won't start unless the phone's been idle. I think what happens is it actively fills empty ram with programs so they will start faster, so I think it's just in the nature of Android.
Click to expand...
Click to collapse
yes but dont they use up cpu/memory/battery? plus i dont think the programs are so resource heavy that they would need a process running.
An answer from a Dev is what we need
I think what we need is an explaination as HOW a program can autostart on boot. If every program on my phone (stored to sd) started automatically when I turned on my phone I'll be waiting a week for it to start up. There has to be a script that these programs add to or something to run these program automatically. Either that or it's the programs themselves that are set up to start up by themselves. Where if that's the case I think we're screwed.
I'm also VERY interested in this.
Also, how to keep apps from auto-restarting once you kill them. PixelPipe has a background service that, once you start the app after reboot, it won't die. Their app support guy states otherwise tho, heh.
Also, I like how the OS says a program has "died"
I wouldn't really worry about it. For one most of those processes will be sleeping. They use no CPU time when they're in this state. Some processes register an event with the kernel and just sleep forever until that event occurs and the kernel reactivates the process. Some processes sleep for a specific amount of time, wake up and do some task, then go back to sleep. In both cases the number of CPU cycles being used are likely negligible. Most of those start-up programs will fall into one or the other category. The stuff that does take up a fair amount of CPU cycles are things like the multimedia system, the UI system, messenging, etc. In other words, the stuff you want to keep running.
Also, I wouldn't pay too much attention to those memory usage numbers. There's heavy use of shared libraries in the system. Ordinarily processes are only allowed to access memory that is allocated to them. This memory is where the process stores the bits that make up its code (stuff that doesn't change) and where it stores its working data (stuff that does change). Its actually more complicated than that but this will suffice for now. Libraries that are not shared are accessible only to the process that is using it and is stored in the memory allocated to it. Libraries that are shared can be used by multiple processes. These shared libraries are allocated to one place in RAM and when an app needs to use one of them the kernel takes care of mapping the location of the library so the app can access it as if it was in its own memory space.
The memory usage numbers you are seeing do not take into account these shared libraries. An app may be using only 1 or 2 MB of RAM but since it uses a shared library the RAM being used to hold the library is also counted and the size could be shown as 20 or 30 MB higher that what it actually is. You could kill a process and recover some memory but its probably not enough to be worth it since more than likely most of the RAM being used was in shared libraries and they'll still be there after the process is gone.
numerik, thanks for the info. But now I guess my bigger concern would have to do with this part:
Some processes sleep for a specific amount of time, wake up and do some task, then go back to sleep.
Click to expand...
Click to collapse
Similar to the problems we run into in windows. Some lame program gets added to msconfig (be it a m$ app or wicked virus), it sits there idle when you fire up your computer uses a minimal amount of cpu amd memory then does who knows what whenever it wants.

Apps starting on their own.

Apps starting on their own. Anyone have these issues? All the att stuff is gone but the video and music player are open randomly as well as quik office. I can see gmail opening and others tho check for updates
Sent from my SAMSUNG-SGH-I897 using XDA App
Yes, this annoys the hell out of me. I wish I knew what to do to stop it. I've even downloaded an app that's supposed to stop things from auto-starting, and it doesn't even work.
Search for StartUp Auditor on the market, it may work for you.
Android Market description
Startup Auditor is one of the original task killer & task manager apps. It is a boot monitor and startup monitor tool which displays a list of applications you may disable.
Terminate processes automatically.
Enable/Disable apps& keep disabled. No root.
Full version eliminates ads and can disable unlimited!
Package: com.vesperaNovus.app.StartupAuditorFree
Click to expand...
Click to collapse
On the advice of this forum I uninstalled my app killer. From time to time I use Android System to see what's running and I notice a number of apps that start themselves. These include the stock music and video players along with Slacker Radio, AT$T Maps, eBay, GPS Status and a dozen others at various times. I don't mean they remain running after exiting, I mean they start without my having used them. What could be causing these apps to start when not called upon? The ones that use GPS put a significant drain on the battery without me knowing it. Any ideas what triggers these apps? I think I'm going back to using an app killer.
Miami_Son said:
On the advice of this forum I uninstalled my app killer. From time to time I use Android System to see what's running and I notice a number of apps that start themselves. These include the stock music and video players along with Slacker Radio, AT$T Maps, eBay, GPS Status and a dozen others at various times. I don't mean they remain running after exiting, I mean they start without my having used them. What could be causing these apps to start when not called upon? The ones that use GPS put a significant drain on the battery without me knowing it. Any ideas what triggers these apps? I think I'm going back to using an app killer.
Click to expand...
Click to collapse
Mine does the same thing. I have Advanced task killer on mine. I dont use it to kill apps, just to look and see how much ram is free and whats running. But all kinds of junk opens by itself.
so does anyone have a fix for this?
derek4484 said:
Mine does the same thing. I have Advanced task killer on mine. I dont use it to kill apps, just to look and see how much ram is free and whats running. But all kinds of junk opens by itself.
Click to expand...
Click to collapse
What use is free RAM when it is kept free all the time?
AJerman said:
Yes, this annoys the hell out of me. I wish I knew what to do to stop it. I've even downloaded an app that's supposed to stop things from auto-starting, and it doesn't even work.
Click to expand...
Click to collapse
Use "start up auditor". With personal experience, this only slowed down my system.
dieselstation said:
so does anyone have a fix for this?
Click to expand...
Click to collapse
This is now android works. The way I see this, this is very much similar to "pre-fetch" concept in windows 7.
I have a 6 GB RAM laptop. Base OS uses less than 1.5 GB of RAM. But like an hour or so when I see my RAM usage, its to the tune of 3-4 GB. What I have noticed is that my most frequently/recently used apps are loaded to RAM and kept there idle. Some amount of RAM is always kept free instead of using up all RAM. This way apps start faster. When I load a different memory heavy program, it pushes the existing one out and loads this.
More or less the same in android too. When u go to any task manager app n see the running apps, u'll notice that many of the apps loaded are the ones u use frequently.
These apps do NOT use any CPU. They are just loaded to memory and kept there for quick access.
When I boot up my phone I have like 190+ MB free RAM. Though left in standy mode, within an hour, I see my free RAM fall to 80-120 MB range. I never saw it go less than 80 MB. And the apps in memory are the ones I used the last time, and the ones I use all the time.
Even if u use a task killer to kill these "inactive" apps at intervals, they would be loaded again sooner or later. That's the principle of android. So by using task killers, though u feel u r freeing up memory, in fact, u r only draining ur battery. What's the use of memory if u r not using it effectively.
Don't worry abt free RAM amount. Let android manage it. Systems are intelligent enough these days.
Hope this helps.
All well and good, but when I look at what apps are using the most resources, the GPS-enabled apps are almost always near the top of the list even when I haven't been doing anything with them. That tells me that they are stealing processor time even when not being used and that can't be good for battery usage.
Miami_Son said:
All well and good, but when I look at what apps are using the most resources, the GPS-enabled apps are almost always near the top of the list even when I haven't been doing anything with them. That tells me that they are stealing processor time even when not being used and that can't be good for battery usage.
Click to expand...
Click to collapse
Install Spare Parts and see battery usage. Do u see any GPS time under CPU usage. Though my system has all these apps loaded up, they don't show up as using CPU time or any sensors unless I use the app.
Android Memory Management
Android Memory Management
Android is a Linux based OS with 2.6.x kernel, stripped down to handle most tasks pretty well. It uses native open source C libraries that have powered Linux machines for years. All the basic OS operations like I/O, memory management, and so on, are handled by the native stripped-down Linux kernel.
How to use memory for each application
Android’s process and memory management is a little unusual. Like Java and .NET, Android uses its own run time and virtual machine to manage application memory. Unlike either of these frameworks, the Android run time also manages the process lifetimes. Android ensures application responsiveness by stopping and killing processes as necessary to free resources for higher-priority applications.
Each Android application runs in a separate process within its own Dalvik instance, relinquishing all responsibility for memory and process management to the Android run time, which stops and kills processes as necessary to manage resources.
Dalvik and the Android run time sit on top of a Linux kernel that handles low-level hardware interaction including drivers and memory management, while a set of APIs provides access to all of the under- lying services, features, and hardware.
Dalvik Virtual Machine Dalvik is a register-based virtual machine that’s been optimized to ensure that a device can run multiple instances efficiently. It relies on the Linux kernel for threading and low-level memory management.
The Dalvik Virtual Machine
One of the key elements of Android is the Dalvik virtual machine. Rather than use a traditional Java virtual machine (VM) such as Java ME (Java Mobile Edition), Android uses its own custom VM designed to ensure that multiple instances run efficiently on a single device.
The Dalvik VM uses the device’s underlying Linux kernel to handle low-level functionality including security, threading, and process and memory management.
All Android hardware and system service access is managed using Dalvik as a middle tier. By using a VM to host application execution, developers have an abstraction layer that ensures they never have to worry about a particular hardware implementation.
The Dalvik VM executes Dalvik executable files, a format optimized to ensure minimal memory foot- print. The .dex executables are created by transforming Java language compiled classes using the tools supplied within the SDK.
Understanding Application Priority and Process States
The order in which processes are killed to reclaim resources is determined by the priority of the hosted applications. An application’s priority is equal to its highest-priority component.
Where two applications have the same priority, the process that has been at a lower priority longest will be killed first. Process priority is also affected by interprocess dependencies; if an application has a dependency on a Service or Content Provider supplied by a second application, the secondary application will have at least as high a priority as the application it supports.
All Android applications will remain running and in memory until the system needs its resources for other applications.
It’s important to structure your application correctly to ensure that its priority is appropriate for the work it’s doing. If you don’t, your application could be killed while it’s in the middle of something important.
The following list details each of the application states shown in Figure (see the attached image) explaining how the state is determined by the application components comprising it:
Active Processes Active (foreground) processes are those hosting applications with components currently interacting with the user. These are the processes Android is trying to keep responsive by reclaiming resources. There are generally very few of these processes, and they will be killed only as a last resort.
Active processes include:
* Activities in an “active” state; that is, they are in the foreground and responding to user events. You will explore Activity states in greater detail later in this chapter.
* Activities, Services, or Broadcast Receivers that are currently executing an onReceive event handler.
* Services that are executing an onStart, onCreate, or onDestroy event handler.
Visible Processes Visible, but inactive processes are those hosting “visible” Activities. As the name suggests, visible Activities are visible, but they aren’t in the foreground or responding to user events. This happens when an Activity is only partially obscured (by a non-full-screen or transparent Activity). There are generally very few visible processes, and they’ll only be killed in extreme circumstances to allow active processes to continue.
Started Service Processes Processes hosting Services that have been started. Services support ongoing processing that should continue without a visible interface. Because Services don’t interact directly with the user, they receive a slightly lower priority than visible Activities. They are still considered to be foreground processes and won’t be killed unless resources are needed for active or visible processes.
Background Processes Processes hosting Activities that aren’t visible and that don’t have any Services that have been started are considered background processes. There will generally be a large number of background processes that Android will kill using a last-seen-first-killed pat- tern to obtain resources for foreground processes.
Empty Processes To improve overall system performance, Android often retains applications in memory after they have reached the end of their lifetimes. Android maintains this cache to improve the start-up time of applications when they’re re-launched. These processes are rou- tinely killed as required.
How to use memory efficiently
Android manages opened applications which are running in the background, so officially you shouldn’t care about that. This means that it closes the applications when the system needs more memory. However, most android users are not very satisfied with how it does its things because sometimes it leaves too many processes running which causes sluggishness’ in everyday performance. We can use advanced task killer/task manager and it does its job very well.
Source:
Code:
http://mobworld.wordpress.com/2010/07/05/memory-management-in-android/
Still doesn't answer the question of why the OS is starting apps randomly and without need. For instance, I have Titanium Backup and SGS Tools installed, but can't use them because I am not yet rooted. So why do I keep finding both programs started in the process list? Is the app making the call to start? If so, what can I change to stop it? Whatever Android does to manage memory, it just seems stupid for it to load programs that are hardly used without my asking it to.
Miami_Son said:
Still doesn't answer the question of why the OS is starting apps randomly and without need. For instance, I have Titanium Backup and SGS Tools installed, but can't use them because I am not yet rooted. So why do I keep finding both programs started in the process list? Is the app making the call to start? If so, what can I change to stop it? Whatever Android does to manage memory, it just seems stupid for it to load programs that are hardly used without my asking it to.
Click to expand...
Click to collapse
This is how the systems work in most systems, not just in android.
Take the new cars for instance. Power is generally sent to brakes when in low gears, though u r not actively engaging them. Why? Since u r at low speeds, higher probability of applying brakes. And when u do apply, since there is already some power already being sent, its faster to brake.
On similar lines is this principle of loading apps into memory in android too. It won't load apps to fill up ur memory. Plus the apps loaded into memory in this way don't use any CPU time (this means no battery usage). This speeds up system.
On a side note, if u feel u really do not need an app, and dont' want android loading that app, get "startup auditor" from market. Select the apps u don't want to persist in memory and don't want to auto start. Beware of one thing here: if u make an app as 'do not persist' in memory, and that app is started manually or by any other app, it would be killed giving FC in the app that's using it.
Note: I coined the term 'do not persist'. I do not have the app anymore to check for the exact term.
Edit: In windows, this pre-fetching is done through a service. And one can disable that service, though not recommended. I am not sure if this is done through a service that is "stoppable" in android.

[Q] Some newbe questions

I have a few questions and thought I'd post them for you Android Ninjas to laugh at. Once you get though recognizing my ignorance though, I'd love some education.
Why does my phone give me errors that it can't move apps to my SD card (says it is full) when I have 7GB free on it?
I tried installing an app and it told me that there wasn't enough room in SYS to unpack the files. Is this related to #1? How can I give more space to SYS?
Do widgets or live wallpaper consume CPU or battery when the screen is off or the phone is locked? In other words, will a sleeping phone with lots of widgets use more power than one with just static shortcuts on the screen?
Is the Android memory management good enough that you don't need to reboot the device every day or so in order to clear everything out and get optimum performance?
I've played with the rooted stock ROM for the Inspire, Revolution 4, and now CM7. I see the differences between the UI interface. But what is the purpose/benefit in changing kernals?
Every evening at 7pm, I get a blank SMS message notification with no content and no sender name/number. When I click to open it, it launches GO SMS, but there is no corresponding message in my list of messages. What is this and how do I get it to stop?
3. yes, the more, the more resources and cpu used. livewallpaper uses more than static wallpaper. more widgets, especially ones that update and use data, use resource more than no widgets, etc.
4. android OS is rock solid. i go weeks without reboot. i just went 540 hours on one boot, and that's just the best one that i paid attention to. it goes longer but after 22 days it loses its fun of keeping track.
5. differetn kernels are for different purposes. some are over clocked for performance. some are under volted for longer battery life. its just ways to tweak the phone to get what you want out of it.

(Guide) A complete maintenance guide to pretty much any android phone

INTRODUCTION
This is a guide made ​​to with help from Xperia X10 users and developers for Xperia X10 users enjoyment but most of the tips contained here are suitable for any phone running Android. The tips contained here focus on WHAT to do to improve the performance of your phone and not HOW to do it, after all, once you know what must be done is to find simple tutorials on how to take these actions.
For some of the tips contained in this guide I assumed that you have just installed a new ROM or formatted / bought your phone recently and have root access but even without these prerequisites this guide can still be useful to most users.
It’s important to say that although most of the tips some are quite basic, some require a little more work and deal with the more delicate parts of your phone, they should be made ​​at your own risk. These more advanced tips often use very specific terminology which you can find more about on XDA Developers or even Google.
Finally I would like to remind that even machines that are made ​​within a few standards can operate in different ways: some phones take better advantage of certain adjustments and settings and not others so it’s impossible to guarantee one hundred percent efficiency for all of you but still I that you make good use of this guide.
Sincerely,
Guilherme "XOT" Oliveira
- Install a good ROM and a good Kernel
Official ROMs are good but custom ROMs are usually faster and in many cases as stable as official ROMs. This is because ROMs are released and thereafter rarely change, custom ROMs are already made by developers who are constantly improving their job to get the most out of your phone. It's very important to research before installing a new ROM, searching always for the one that meets your expectations and relates well with your device since the same ROM can work very well on my x10 but not as well on x10 my brother’s for example.
The same goes for Kernels, but with Kernels take extra care to make sure that the Kernel is compatible with your desired ROM and your phone.
- Keep clean your caches
Caches are good to keep certain information and have access to these faster but with these files and information some "garbage" is stored .
The solutions to this can be pretty basic or advanced, the most basic way is to enter your Application Manager (Settings> Applications> Manage Applications) and clear the cache for each application. It is important to clear the cache only and not application data as these may be important such as the files that resemble your progress in a game. Already the most advanced solution is to clear the Dalvik Cache and Cache Partition through your recovery.
Both solutions don’t need to be made ​​with daily frequency, for example I usually clean my caches every 45 days or when I feel that the phone is getting slow.
- Make a full, but clean, backup
Full backups (full system backup) like those made ​​by recovery or nandroid are great to store complete setups but when they are done with “dirty” files in the the phone’s memory restoring these files may worsen rather than help the situation of your device .
Ideally, do a full backup after completely configure your phone (configure your account, set your homescreens, install the required applications, etc.) but before using it for real.
That way if your phone starts getting slow and nothing works to reverse the situation you can easily go back to your “original” settings without the hassle of customizing everything in its way again.
- Do not touch the CPU / GPU the first day
Like people, phones also take a while to adapt to a new environment, or in our case new ROMs, so during the first 24 hours of use is important to use the settings of CPU and GPU that came with the ROM, no overclock, undervolt and things like that.
Another important step in the process of adaptation to the new ROM is really using and exploring the device in this very first day so it "get used" to the change. Do not mind the battery consumption, that should stabilize after a few days.
It’s also iimportant to remember that some ROMs already comes with overclock, undervolt and improvements in battery usage. In this case there is no problem in using these settings from the first minute because if they are there since the installation of the ROM, it is because they are part of the default settings already programmed and develop on this particular ROM and it will work better this way.
- Use the maximum your battery
Batteries seem to last less and less as time goes on, in part this is because your battery is uncalibrated and there are ways to fix it.
I will not talk much on this subject because it is very easy to find guides that teach you how to calibrate your battery so I’ll just recommend that you take a look at them.
- Applications: less is more
Having millions of apps is the glory and the doom of smartphones, the glory because you can do everything on your device and doom because of the following reasons:
As a computer your phone also slows down the as it becomes full and in most cases you can blame it on the number of apps that you have installed on it. So try to leave installed only the applications you actually use and uninstall the ones that you no longer use so you can have more free memory and consequently a faster device.
Some applications can not be uninstalled because they are system applications; in order to remove those apps you are going to need uninstallers that have root access (ex: RootUninstaller) which are capable of removing these applications but before taking such a measure is necessary to look for a safelist (a list of applications that can be removed without causing system problems).
Keeping a low number of applications but doing so by installing and uninstalling new apps every day also usually let the machine slower so if you find an application for a specific function that fits your needs you should stay with it instead of testing another 10 before returning to it.
PS: A good way to avoid testing several applications before finding the right one is reading reviews and comments before making your choice.
- Repair defective applications
Often the phone is working fine but a certain application or function is not, which can cause slowdowns and FCs (force close); depending on the situation there is not much to do but some of these solutions may take care of the problem:
The first thing to do is to uninstall and reinstall the apps via Play Store to make sure that the problem was not caused by a corrupted file when you downloaded the application, if the problem persists there are some more advanced alternatives: in the advanced settings of your recovery select fix permissions, this function should make sure that every application has the necessary permissions to work properly.
- Keep some free space
Full memory is often a problem on any device, especially in older phones like ours, after all the more files the longer it takes read all these files if it is necessary, so the tip is this: the more free space the better.
This step seems a little redundant since we already talked about having the smallest possible number of applications but this time we are also talking about other files. Anything occupying space on your phone is "bad"; too many photos, songs, text documents, etc.. can make the phone slower and lets be honest, you do not need to carry 150 photos of your last weekend with you all the time.
A solution to this problem is simple, try to keep the memory of your phone as free as possible by eliminating caches, unused files and moving applications to the SD card (Settings> Applications> Manage Applications> choose the application and select Move to SD card or use apps like Link2SD); your SD card should also be kept clean by eliminating unused files and traces left by already uninstalled applications, such traces are sometimes hard to find and applications like SD Maid can help you eliminate much of this "junk".
- Avoid keeping some applications running all the time
It’s very common to close an application and assume that it stopped running on the system but this is not always the case because it actually still cached in the memory of the device, Android makes it to be faster on reopening it later and often the system itself definitively closes the application automatically but that’s not always the case.
Firstly it is important to prevent certain applications from even opening and to do this we use apps known as Startup Managers, there are several options in the Play Store but I particularly like Autostarts. Once inside your Startup Manager you can choose which applications will be opened as the system is started or any action is taken (for example changing the state of your Wi-Fi); the ideal is to minimize the number of self-starting applications, leaving only the truly necessary ones without forgetting to be very careful to avoid stopping system applications because if they are unable to open themselves it can cause instability. Another way to prevent applications from opening or stay on cache all the time is to disable automatic updates of apps such as email clients and social networks but this is a more personal matter that varies from user to user, just remember that the more constant the updates are, the more time these applications will be running in the background and more power (CPU and battery) will be consumed.
Now that we’ve already took care of the self opening apps it’s time to find out when you really need an app to be closed for sure.
It's easy to know when to quit an application completely but it is necessary to first understand a basic concept about the system: applications and processes cached in memory are not always a bad thing, in fact as stated at the beginning of the topic they are a good thing because the application should open faster when launched again (hence the use of Task Killers usually worsens more than help if not done properly) but if you use an application to view the weather every morning and will only use it again the next morning this application can be closed without problems.
In our current official version of Android (2.3) already have a task manager that can be used to do this action (Settings> Applications> Running services > select the desired process and press Stop) but if you want a more advanced option there are several Task Managers that monitor processes and can be used to close them too.
PS: Again about the Task Killers: although its use is discouraged for the day-to-day because of the reasons already explained, if you plan on haevy gaming they can be the great saviors since these games need a lot of free memory to run without lags.
- SMS: clean your inbox
Message apps, both native and third-party tend to take quite some time to open if you have many messages on your mobile because everytime you run your message app it needs to load a large list of conversations, so cleaning your inbox periodically helps performance, the same goes for call log.
A tip for those who want to clear the messages inbox and call log without losing your information is backing up with applications like SMS BackUp + that emails you both your conversations and call logs, all within a specific marker so they won’t end up messing the inbox of your email or if your intention is to save only one or two most important message the native client and most ones available at Play Store have the option of forwarding SMS, simply by holding your finger over until the action menu opens up.
- Give your device a break
Like conventional systems for computers, Android also collects information in its memory and despite the “dumping information system” some of it is left in cache , which ends up requiring more processing on your device.
To end this there is a very simple solution: give a rest to the phone. Once a day or when you feel like the machine is running slow give it a reboot or shut down and leave it off for a minute or two before restarting, it should get rid of the cache and it can boost the speed of the phone, but attention: restart the machine and making it open up various apps on boot has no point so keep your boot clean (see related topic).
- About some specific applications:
Task killers (that goes for any app of this kind) are good for a heavy gaming experience (eg: GTA, Dead Space, Asphalt...) because those games need a lot of free RAM but for everyday use is preferable to don't use task killers and keep some of the apps in the cache so they open faster when they are requested again.
Deep sleep is an important part of the ROM performance when it comes to battery usage, applications like CPU Spy can check if this function is working correctly or No-frills CPU Control which in addition to monitoring provides the ability to adjust the frequencies and governors you want to use in your phone.
Chainfire3D is an useful app to change the way your GPU will work and customize it to gain performance or quality , notice that these values ​​tend to be inversely proportional.
Try always to use the lightest possible applications, it helps in memory. I for one think the galleries and music players of almost all default ROMs are too heavy and prefer apps like QuikPic and UberMusic.
Finally I would like to thank: XDA Users: Oodie, x10forevers, Vasishta Reddy, DiKeJ, 9Lukas5, FeraVolt, alzbac, Websites: lifehacker.com, limitlessdroid.com , doctor-android.com, androidcentral.com for helping with the tips on this guide and say that if you have a tip that is not in this guide feel free to share with us!
PS: I'm sorry if I made some grammar mistakes, English is not my first language and this is a pretty big article.
thanks...nice one..
Dude I screwed my music thing on x10 . Please help . Tried flashing xperia s music player . Now music icon has dissapeared . N power button seem to reboot all the time . Will updating binary files of xrec n then flashing again help ?
Please tel . Desperately.
Rooted x10 2.3.3 stock Rom
Sent from my X10i using xda premium
theMoiz94 said:
Dude I screwed my music thing on x10 . Please help . Tried flashing xperia s music player . Now music icon has dissapeared . N power button seem to reboot all the time . Will updating binary files of xrec n then flashing again help ?
Please tel . Desperately.
Rooted x10 2.3.3 stock Rom
Sent from my X10i using xda premium
Click to expand...
Click to collapse
Hey dude, I don't really know how to help you because I haven't had any similar problems but I'm pretty sure that you should try the basics: clear caches (dalvik included) and fix permissions.
Since I'm not a developer I can't really help you with the binary files but try reaching your ROM's developer and he might help you
I hope you get your phone fixed
Dude u sure that I should clear off dalvik cache ? I tried fixing permission but still nothing . The power button rebooting the phone is more irritating than not having a default music PLAYER . Im asking in this forum but havent got the solution yet :'(
Sent from my X10i using xda premium
Excellent post Buddy . Hope you update the thread with other power users opinions & Tips .
Thanks.
Oodie.
theMoiz94 said:
Dude u sure that I should clear off dalvik cache ? I tried fixing permission but still nothing . The power button rebooting the phone is more irritating than not having a default music PLAYER . Im asking in this forum but havent got the solution yet :'(
Sent from my X10i using xda premium
Click to expand...
Click to collapse
I think that the only people that can help you are the ones on your device's specific forum man, try creating a topic there
Sorry but I really don't know what to do to fix your phone
Some of the tips are a complete waste of time and utter crap (mostly those related to keeping RAM usage low and task killers [EDIT: actually, you contradict yourself on these points], giving the device time to "adapt" to the environment -seriously?- and going for the lighter apps -this obviously applies if you have an outdated device, but it's not a rule).
EDIT: Forgot to say that the rest is good.
GermainZ said:
Some of the tips are a complete waste of time and utter crap (mostly those related to keeping RAM usage low and task killers [EDIT: actually, you contradict yourself on these points], giving the device time to "adapt" to the environment -seriously?- and going for the lighter apps -this obviously applies if you have an outdated device, but it's not a rule).
EDIT: Forgot to say that the rest is good.
Click to expand...
Click to collapse
As I said the guide was wrote based on Xperia X10 user experience so it is kind of an old device.
About the RAM management you won't have any issues with a top device with a lot of free RAM but in our case (old device users) we have about 256mb or less RAM to work with so keeping it well managed is essential if you want your device to run smooth.
The adaptation thing seems like BS but it's not, because your device need to create/edit some files as its being used and that's what this part of the article really means. For example your battery writes a log about its own capacities (making a long story short by recalibrating your battery all you do basically is reset this log)
Thanks for the feedback, hope you found something usefull
GuilhermeXOT said:
As I said the guide was wrote based on Xperia X10 user experience so it is kind of an old device.
About the RAM management you won't have any issues with a top device with a lot of free RAM but in our case (old device users) we have about 256mb or less RAM to work with so keeping it well managed is essential if you want your device to run smooth.
Click to expand...
Click to collapse
No, it's not essential. It's actually bad.
The lifehacker website seems to be down, so I'm giving you a link to this article instead (the article itself links to three more detailed articles; one of them is the lifehacker article I wanted to link; do read them): http://androidandme.com/2011/11/app...lers-still-dont-give-you-better-battery-life/
EDIT: Regarding the battery, draining the battery (to 0% or close) is actually bad for lithium based batteries and should be avoided. A discharge to 15% is usually enough.
GermainZ said:
No, it's not essential. It's actually bad.
The lifehacker website seems to be down, so I'm giving you a link to this article instead (the article itself links to three more detailed articles; one of them is the lifehacker article I wanted to link; do read them): http://androidandme.com/2011/11/app...lers-still-dont-give-you-better-battery-life/
EDIT: Regarding the battery, draining the battery (to 0% or close) is actually bad for lithium based batteries and should be avoided. A discharge to 15% is usually enough.
Click to expand...
Click to collapse
I get your point and I also talk about the same thing as the article in the guide: "the use of Task Killers usually worsens more than help if not done properly" , I just didn't elaborated on this very much.
Now, what I'm saying is that if you are a day-to-day user you don't need a task killer and it's recommended ONLY for a gaming experience, aka heavy games like GTA, Dead Space, etc...
"Task killers (that goes for any app of this kind) are good for a gaming experience but for everyday use is preferable to keep some of the apps in the cache so they open faster when they are requested again."
I'm not a task killer fan myself but if you check any gaming rom (DikeJ's for x10 is a good example) you can see that the developers try to maximize the free RAM because those heavy games use a lot of it.
So in order to avoid this kind of confusion I'll edit the article to solve this misunderstanding thx for the heads up
GuilhermeXOT said:
I get your point and I also talk about the same thing as the article in the guide: "the use of Task Killers usually worsens more than help if not done properly" , I just didn't elaborated on this very much.
Now, what I'm saying is that if you are a day-to-day user you don't need a task killer and it's recommended ONLY for a gaming experience, aka heavy games like GTA, Dead Space, etc...
"Task killers (that goes for any app of this kind) are good for a gaming experience but for everyday use is preferable to keep some of the apps in the cache so they open faster when they are requested again."
I'm not a task killer fan myself but if you check any gaming rom (DikeJ's for x10 is a good example) you can see that the developers try to maximize the free RAM because those heavy games use a lot of it.
So in order to avoid this kind of confusion I'll edit the article to solve this misunderstanding thx for the heads up
Click to expand...
Click to collapse
Cool, thanks for that
Buddy, that guide is awesome written, excellent work. And big thanks for credits - I'm very proud that I could help in that "project" ^^. It's should hit XDA Blog . Cheers .
DiKeJ said:
Buddy, that guide is awesome written, excellent work. And big thanks for credits - I'm very proud that I could help in that "project" ^^. It's should hit XDA Blog . Cheers .
Click to expand...
Click to collapse
I'm the one who have to thank you
People please share your ideas so we can make this guide better!

Categories

Resources