Related
Hey guys,
I have some doubts in the cache in phone which need your expertise in.
Why is it that sometimes our phone will get sluggish and laggy, and we need to reboot it or clear cache to make it back to fast again? I thought in Android (linux), that ram is needed to run any applications and it does not depend on the space (data storage) we have left in the phone. So what does clearing cache has to do with the performance of the phone?
Thanks for your time.
Anyone have any ideas on this?
What are you talking about specifically? Clearing application cache? Doing this will have ZERO effect on device performance ***EXCEPT*** when running THAT SPECIFIC PROGRAM. It could make that program itself faster or slower to clear the cache. The purpose of cache is to improve performance by making the data available locally, however, if the data required is NOT IN CACHE, then having cache will slow it down as a result of having to process the cache.
Note: If you are running a custom hacked firmware using swap or compcache, then rebooting will clear some things up and make it faster. This is another form of cache that gets cleared. Ultimately, without frequent reboots, use of swap will tend to slow the device down over time, and this is cleared by rebooting.
Erm oki, so is it better to do without swap in this case as i'm using a custom firmware?
Let's say I am running 1 foreground application with 5 background applications (sleep) and another side running 1 foreground application with 15 background applications (sleep). This is just an example. In this 2 cases, will the speed of running the 1 foreground application be the same with the different number of background applications there?
Anyone have any ideas on this?
No one know anything about this issue?
I guess it's because the database gets huge and this may be bad for the performance...
so like a big registry in windows is bad...
maybe also some fragmentation... who knows
I have determined that a lot of my low space issues in the data/data folder are from nearly 120MB of 'system data'. I was confused but willing to work around it since system data is usually pretty important.
However, I recently set up my wife's cappy just like mine (same ROM, Kernel, Modem) and she only has 8MB of system data in her data/data folder
So, now I'm looking to understand what system data goes into that folder. I know I could do a complete clean install to figure parts of it out, but if there is an answer out there it would be much easier than the pain of a clean install.
I'm sure someone will correct me if I'm wrong, but I believe all of your application data (cache & user data, but not the applications themselves) lives in there. If you go through your application list and clear the caches, or use a cache cleaner from the market, you should be able to free up much of that space.
The nice thing about the cache cleaners from the market is that they will sort by cache size so you can see which programs hoard cache space (*coughFacebookcough*)
I've thought of that, and 1 Tap Cleaner only shows 1MB in cache. In fact, since I haven't been using a lot of my apps while figuring this out, nearly all of them are 0 cache.
Is there something that 1 tap cleaner is missing?
Cache is the easiest way to free up space, but I believe all of your user data, databases, etc. live in there as well. If you move some apps to the SD card, I think it takes the user data with it which should free up some space.
You could also go through and clear the user data from apps that have big databases (like Facebook), but this will clear all of your settings and account info. Once you start using it again, this is obviously going to start filling up again but I find it a bit hard to believe that my username, password, and settings really need to occupy the 3.06mb that it's currently taking up on my phone. It must be accumulating crap somewhere along the way.
I've moved some apps to SD w/o really affecting the amount stored there. I have also cleared some data which did help, but doesn't affect the system data.
That's the strangest part. The system data seems to be ~120MB no matter what I do. From all I can find, I only have approx 35MB of actual application user data... the rest is listed as system data, which I can't break down any further.
I've heard of the contacts storage going haywire and taking up space. Have you tried checking and/or clearing that one? Obviously you'll lose anything you don't have backed up with Google.
If that doesn't help, I'm out of ideas short of wiping all of your data and starting over.
Huh... I'll check into the contacts one. I'll report back here with what I find.
Thanks!
Darnit... only 4MB was in contact storage... and it didn't seem to affect my system data.
I guess I'll start preparing to start over. I think I may have done a backup after i fresh installed everything... perhaps I could reinstall that and see what things looked like!
Thunderbolt adds a sqlite_optimize script which defrags databases. That may help reduce the size.
Any time I use Titanium Backup to restore my apps, I do it in chucks and never restore system data since I'm always changing ROMs. For chunks I mean restore apps+data only for apps that need it, then restore apps without for all the rest. Any apps which I don't run never save any data so it saves space.
I have the 8 GB model and over the past couple months it has really started to slow down. Everything from opening apps to changing the screen orientation to unlocking the device was really slow. It was nothing like the buttery smoothness I enjoyed when I first received the device. I recently fixed my lag by clearing the cache using a program called Clean Master. The steps I took are as follows:
1) Download and Install Clean Master from the market
2) When you open the app, there will be 4 choices. Select History
3) Give the app some time to calculate all the cache being used. When it finishes, make sure System Cache is checked and then click the clean button on the bottom.
That's it. After I did that I noticed a dramatic improvement in the tablet's responsiveness. I know that you can also clear your cache out in Settings > Storage > Cached Data. That may or may not do the same thing, but for me I used Clean Master and it worked.
I did a search and couldn't find this posted so I wanted to share it in hopes of helping others out. So for those of you with lag, give this a shot and let me know if it helps you out. If it does, maybe we can discuss why this works and what the root cause of the problem is in the first place.
u dont need to install 3rd party cache cleaner in android now (ICS and JB)
go to settings>Storage>cached data
click on it and clean it.
and please this is well known method so please use search before starting a new thread.
Closed, addressed in other threads
Okay guys,
with the introduction of 4.4 kitkat, Google decided to include ART as an optional second runtime that can be enabled through developer options. Naturally when promised faster app launch times, people will turn it on. ART is not stable however and so problems will be occur. For this reason, in hopes to prevent kernel developers, rom developers, and android developers from having their thread hijacked, I am making a thread dedicated to runtimes here. DO NOT POST ABOUT THIS TO DEVELOPERS ON THEIR THREADS, bugs when you are running ART are not their fault.
What is Dalvik?
Dalvik is the process virtual machine (VM) in Google's Android operating system. It is the software that runs the apps on Android devices. Dalvik is thus an integral part of Android, which is typically used on mobile devices such as mobile phones and tablet computers as well as more recently on embedded devices such as smart TVs and media streamers. Programs are commonly written in Java and compiled to bytecode. They are then converted from Java Virtual Machine-compatible .class files to Dalvik-compatible .dex (Dalvik Executable) files before installation on a device. The compact Dalvik Executable format is designed to be suitable for systems that are constrained in terms of memory and processor speed. Dalvik is open-source software.
Dalvik is named after an Icelandic city.
(source)
Okay so what is ART?
ART is a project Google has been working on for reportedly for 2 years. The goal of ART was to produce a faster runtime that wouldn't suffer from the problems Dalvik suffers. Android Kit Kat 4.4 is the first operating system with ART included in developers options although it is unclear just how recent this version is.
ART stands for Android RunTime
(source)
Great, Whats the Difference Then?
The main difference between ART and Dalvik is when they compile app code. Dalvik operates under a JIT (Just In Time) compilation method which means that when developers make their apps, they partially compile their code into bytecode which is interpreted by the java virtual machine. Dalvik converts bytecode to machinecode as the app runs to increase performance (bytecode execution is slower than machinecode execution). ART differs from Dalvik by performing this compilation of bytecode to machine code at installation of the app and saves this to the phones storage (not ram).
(source)
So Why Use ART?
Using ART instead of Dalvik allows the system to use much less resources during runtime. When apps are running, interpretation of bytecode is not ongoing, this can reduce CPU load and RAM usage. The resulting effect is faster app startup times (reportedly almost twice as fast) and better in app performance.
It should be noted that performance boosts will only really improve for the java components of apps. Apps like games which rely on the NDK or other languages will receive more incremental experience boosts.
(source)
Why Shouldn't I Use ART
Well first and foremost, Google's documentation of ART suggests not using ART because it can cause app instabilities and an unstable android implementation all together. It is still largely in development and it is unknown just how recent the version included in the current kit kat build is. Google is introducing it to the development community but really doesn't intend users to use it as a daily runtime.
Also since ART precompiles and saves that precompiled code upon installation of apps, it takes up more storage. The increase is about 10-20% of the code in the application. Remember the majority of apps usually comprises media files such as images, videos, sounds... so those components will be unaffected. For example, the Google+ apk is about 28Mb yet the code is only comprise of 7Mb. The increase in storage size is nominal, but worth noting.
Also the first start up after enabling ART can take up to 10 minutes due to this compilation occurring. Installation of apps will also take slightly longer but with hardware on the Nexus 5 you are unlikely to even notice.
ART also can cause issues with app backup and restoration.
(source) (source)
Custom Roms and ART
As developers start building Kit Kat roms from source they will have to decide if they would like to include ART in their builds. Google has created a flag to include ART in addition to Dalvik. This is a simple implementation, but if threads keep getting hijacked by discussions of ART and bugs, I wouldn't be surprised if developers choose to exclude ART from their builds.
ART also cannot function with deodexed apps. The odex files are necessary for bytecode to machine code compilation. Flashing a deodexed ROM or gaps with ART enabled will produce force closes and crashes to the point the UI won't be functional.
Also initial setup between Roms will take longer with ART since performing a factory reset as well as clearing caches will clear the stored precompiled code that ART saves. Dalvik will always be enabled at start up, so switching to ART will require a reboot and a wait for set up.
(source)
In my synopsis of ART and Dalvik I may have made a mistake or two or not explained something properly. If you spot a mistake or would like clarification, simply post and I will modify the OP.
Please, please, please send people to this thread if they are asking about runtimes in a developers thread. Having had my kernel thread hijacked by unrelated issues that are outside of my control, I understand the pain.
ART breaks Titanium Backup, just fyi
Sent from my Nexus 5 using Tapatalk
And quadrant and whatsapp
afazel said:
ART breaks Titanium Backup, just fyi
Sent from my Nexus 5 using Tapatalk
Click to expand...
Click to collapse
added to OP
I will not be posting a complete list of apps broken by ART, it would take way too much time and this is likely to change as the developers get to update their code to be optimized on 4.4. You are welcome to post any issues, but its pretty much ART can break a lot of apps.
I find app compatibility remarkably high. I have over 60 apps installed and the only ones that aren't working is titanium backup and greenify.
Everything else works even games like asphalt 8 and pvz2.
dwang said:
I find app compatibility remarkably high. I have over 60 apps installed and the only ones that aren't working is titanium backup and greenify.
Everything else works even games like asphalt 8 and pvz2.
Click to expand...
Click to collapse
Games generally are not coded in Java (usually NDK or something else) and so they will be effected much less by ART than other apps.
I thought that the play store felt noticeably faster when using ART when I was installing a bunch of apps last night.
Titanium backup and whatsapp instability are huge deal breakers for me, unfortunately.
Sent from my Nexus 5 using XDA Premium 4 mobile app
dwang said:
I find app compatibility remarkably high. I have over 60 apps installed and the only ones that aren't working is titanium backup and greenify.
Everything else works even games like asphalt 8 and pvz2.
Click to expand...
Click to collapse
greenify seems to be working fine for me with ART. What problems are you experiencing?
agalvin13 said:
greenify seems to be working fine for me with ART. What problems are you experiencing?
Click to expand...
Click to collapse
Perhaps a reinstall on ART would fix the problem?
Hi,
I know this may sound really stupid but.. can you guys write down some of your most used Apps that are written in Java? Do you notice any performance improvement?
Also, does ART affect overall android experience (original apps, launcher).
I am no developer and I don't know much about computer languages (so please don't throw rocks at me for those questions) but I like to tweak my phone to see what seems to be the best for my phone.
Does ART affect battery life?
Sent from my Nexus 5 using Tapatalk
MrBelter said:
And quadrant and whatsapp
Click to expand...
Click to collapse
Quadrant is working just fine for me.
busab said:
Does ART affect battery life?
Sent from my Nexus 5 using Tapatalk
Click to expand...
Click to collapse
It theoretically will and could. I haven't noticed a markable increase in battery life so far though. One would have to perform some test but scrolling and apps loading seems more fluid imo. I am leaving it on.
busab said:
Does ART affect battery life?
Sent from my Nexus 5 using Tapatalk
Click to expand...
Click to collapse
Not sure, tomorrow I'll see and report back.
It's not like the new Holy Grail to me, performance wise...
busab said:
Does ART affect battery life?
Sent from my Nexus 5 using Tapatalk
Click to expand...
Click to collapse
Theoretically, yes since it attempts to decrease cpu load and ram usage at runtime, it should theoretically give you some better battery life. But battery life is hard to gauge, so don't expect any definitive results on that anytime soon.
miHah said:
I know this may sound really stupid but.. can you guys write down some of your most used Apps that are written in Java? Do you notice any performance improvement?
Also, does ART affect overall android experience (original apps, launcher).
I am no developer and I don't know much about computer languages (so please don't throw rocks at me for those questions) but I like to tweak my phone to see what seems to be the best for my phone.
Click to expand...
Click to collapse
Pretty much all apps that are regular run of the mill apps will be coded in Java. It is just intensive programs like games are generally coded using the NDK, but all other apps in large will be in java (the vast majority).
When you say original apps, I assume you mean system apps like the GE Launcher, or settings app. These are all coded in java so yes they will get improvements too.
EDIT: if you want what is best for your phone, stick with dalvic, it's more stable.
Something I noticed with the Nexus 4 (Dalvik, obviously) is that if you have a lot of apps (10+ maybe?) open, the recent apps will take a slight delay to show up. It isn't lag, but it even appears with the Nexus 5. If you switch to ART, the recent apps will show up immediately, no matter what. I'd say that alone would be worth it to switch to ART, it makes everyday use feel notably smoother.
aletto said:
Something I noticed with the Nexus 4 (Dalvik, obviously) is that if you have a lot of apps (10+ maybe?) open, the recent apps will take a slight delay to show up. It isn't lag, but it even appears with the Nexus 5. If you switch to ART, the recent apps will show up immediately, no matter what. I'd say that alone would be worth it to switch to ART, it makes everyday use feel notably smoother.
Click to expand...
Click to collapse
I agree - the bad part is that it breaks tibu and whatsapp. Why can't devs be a bit more on their toes when an update comes ?
Been running ART for a full day now, and aside from TB, I've had no issues. Greenify works fine, and I don't use Whatsap, so hopefully by the time custom ROMs that support ART come out, TB will be updated to fix this issue. If not, oh well. I'll stick with it for now seeing as how much better some notoriously slow and crappy apps are running. Maybe it's just a placebo, but I've never seen the Facebook app load so quick and scroll so smoothly as it does now.
My phone started lagging after I selected use ART in runtime...
I noticed that my Free RAM got increased not I m getting 450+ free RAM but phone processing got slow..
Even I tried ART Runtime and most of the Apps started crashing and the phone started to heat up, so switched it back to Dalvik.
I found some discussion going about this in Android Central forum here
I think for now Dalvik is the better option , since ART is not supported yet in 4.4.4.
Android L has it though!
I noticed that too. A few apps started crashing after i changed.
Besides that, everytime i reboot my phone the message that my android is being updated and the apps are being optimized.
I used Art on Nexus5, worked smoothly, for some reason my Moto G 1st Gen and Moto G 2nd Gen don't work half as smoothly as the Nexus 5. Anyway lollipop will be out soon, so no worries
ART was quite OK in Moto 2013, but due lack of disk space, I used Dalvik. In Moto 2014 ART is very slow, apps crashes etc.
Not sure why you all are having problems. I've been running ART since receiving my phone 3 weeks ago and haven't had a single app crash, nor do I see any lag at all.
+ Every time my phone boots...
I see a message...
" Android is upgrading.... Optimizing apps.."...
So switched back to Dalvik...
I think ART having problem with kitkat..
My phone stopped upgrading on each boot, this might be the solution:
http://forum.xda-developers.com/showpost.php?p=56506819&postcount=27
temuulenchoi said:
My phone stopped upgrading on each boot, this might be the solution:
http://forum.xda-developers.com/showpost.php?p=56506819&postcount=27
Click to expand...
Click to collapse
I'm not using ART anymore because its not yet compatible with Xposed, but it seemed to work well when I used to use it.
It stopped doing the "upgrading apps" thing at startup after about 5 reboots.
This may help you...
cyb3rillusion said:
My phone started lagging after I selected use ART in runtime...
I noticed that my Free RAM got increased not I m getting 450+ free RAM but phone processing got slow..
Click to expand...
Click to collapse
Dalvik is based on JIT (just in time) compilation. It means that each time you run an app, the part of the code required for its execution is going to be translated (compiled) to machine code at that moment. As you progress through the app, additional code is going to be compiled and cached, so that the system can reuse the code while the app is running. Since JIT compiles only a part of the code, it has a smaller memory footprint and uses less physical space on the device.
ART compiles the intermediate language, Dalvik bytecode, into a system-dependent binary. The whole code of the app will be pre-compiled during install (once), thus removing the lag that we see when we open an app on our device. With no need for JIT compilation, the code should execute much faster.
ART is an ongoing project, considered too unstable to be introduced as a standard runtime in 4.4.4 Kitkat
"So before you switching the Runtime from Dalvik to ART you have to reset entire mobile or clear the Dalvik cache via CWM and then install the apps you want to run.". Because the cache memory created by Dalvik runtime won't allow the ART to run Lagfree.