What does wiping delvik-cache actually do? - Hero, G2 Touch Android Development

Just wondering what wiping delvik-cache actually did... I know the 'duh it wipes your delvik cache' answer is right on the tip of your tongue but what I mean is, what do you lose from wiping it? What's actually stored in there? Anything that would break from wiping it?

itpromike said:
Just wondering what wiping delvik-cache actually did... I know the 'duh it wipes your delvik cache' answer is right on the tip of your tongue but what I mean is, what do you lose from wiping it? What's actually stored in there? Anything that would break from wiping it?
Click to expand...
Click to collapse
This would have been more appropriate in the Q&A section... however...
As I understand it, the dalvik cache stores optimized versions of your application dex files. The dex file is a dalvik executable file and is filled with dalvik bytecode. It is very similar to java in that regard. Most of the stock apk's located in your phone's rom have odex files which are optimized dex files not needed to be stored in the cache. I am unsure as to wether or not they actually are.
Clearing it shouldn't be a problem, you may notice a slight startup lag the next time you open an application after wiping the cache as it repopulates the dex files. There is also a possibility of the cache getting filled with left over garbage if you install/uninstall apps frequently. However I can't back that up with any personal experience or research.
Anyone, feel free to correct me if I have given any false information.

obelisk79 said:
This would have been more appropriate in the Q&A section... however...
As I understand it, the dalvik cache stores optimized versions of your application dex files. The dex file is a dalvik executable file and is filled with dalvik bytecode. It is very similar to java in that regard. Most of the stock apk's located in your phone's rom have odex files which are optimized dex files not needed to be stored in the cache. I am unsure as to wether or not they actually are.
Clearing it shouldn't be a problem, you may notice a slight startup lag the next time you open an application after wiping the cache as it repopulates the dex files. There is also a possibility of the cache getting filled with left over garbage if you install/uninstall apps frequently. However I can't back that up with any personal experience or research.
Anyone, feel free to correct me if I have given any false information.
Click to expand...
Click to collapse
That's perfectly correct.
For any app that's not accompanied by an odex, an optimized extracted copy of it's bytecode is stored in dalvik-cache.
I've yet to see if uninstalling an app also erases it's respective dalvik-cache or not, checking for that hadn't crossed my mind, but I don't see why it shouldn't.
The real reason you're supposed to wipe your dalvik-cache is because sometimes between builds you get two versions of an app that have the same namespace. The VM will try to use the already stored cached bytecode, but there's a chance that it might be incompatible and it will cause a force-close, in that case, it's best to let the vm build new optimized bytecode for the app, but, as obelisk pointed out, it's going to take a while to re-build the dalvik-cache if you erase it all (the more apps with a .odex you have, the less time it takes).
I think in 2.0 there's now a routine where the dalvik-cache is checked against the app .dex for compatibility, I might be wrong though, but I think I've seen it erase old caches and create new ones. It might be something else entirely though.

I know I'm off topic but your sig made me chuckle.

Related

[Q] Dalvik Cache and Clockworkmod Questions

In Clockworkmod 2.6.0.1
Why is Clearing Dalvik Cache in Adavanced and not side by side with other Clearing items on main menu?
Why isn't Dalvik Cache cleared with a full Data/Cache Clear?
What's in Dalvik Cache vs Cache?
Anyone have any idea why when I select Clear Dalvik in Clockworkmod that sometimes it takes a while to display the "Are you Sure" page? Seems completely random. Most of the time it comes up instantly as all confirmation pages. But once in a while it just sits there for a while and then it pops up.
my answers are as follows
1. don't know
2. not sure
3. I'll leave that to an expert
All I know is that all of the problems I was having went away when I switched to Amon. Probably not the answer you're looking for, but you may want to look into Amon if you are having recovery concerns.
When I used Clockwork, it did seem like the Dalvik cache wipe really didn't do anything, and according to a lot of the Devs, it doesn't. I always had major problems with clockwork, even considered unrooting because the phone had so many post wipe/flash issues.
If it ain't broke don't fix it.
If I have a problem I'll check out Amon but the delay I see when choosing it is not a problem as far as I know, I was just curious what it was. Perhaps it's the order I might do something.
I also wanted to understand more about what it actually is.
mswlogo said:
In Clockworkmod 2.6.0.1
Why is Clearing Dalvik Cache in Adavanced and not side by side with other Clearing items on main menu?
Why isn't Dalvik Cache cleared with a full Data/Cache Clear?
What's in Dalvik Cache vs Cache?
Anyone have any idea why when I select Clear Dalvik in Clockworkmod that sometimes it takes a while to display the "Are you Sure" page? Seems completely random. Most of the time it comes up instantly as all confirmation pages. But once in a while it just sits there for a while and then it pops up.
Click to expand...
Click to collapse
From Android Forums: "Dalvik cache is a program cache area for the program dalvik. Dalvik is a java based virtual machine that is the bases for running your programs (the ones that have the .apk extension). In order to make access times faster (because there's not JIT (just in time) compiler installed by default), the dalvik-cache is the result of dalvik doing an optimization of the running program. Sounds confusing. It's similar to the prefetch files in Windows."
As for why Dalvik is located where it is in CW 2.6...have no idea but wish it was located out of the Advanced section to make it easier to get to. However, I believe 2.6.0.1 is wiping Dalvik properly even though sometimes it doesn't confirm it. Still think AR 1.8 is best recovery of all.
CCallahan said:
From Android Forums: "Dalvik cache is a program cache area for the program dalvik. Dalvik is a java based virtual machine that is the bases for running your programs (the ones that have the .apk extension). In order to make access times faster (because there's not JIT (just in time) compiler installed by default), the dalvik-cache is the result of dalvik doing an optimization of the running program. Sounds confusing. It's similar to the prefetch files in Windows."
As for why Dalvik is located where it is in CW 2.6...have no idea but wish it was located out of the Advanced section to make it easier to get to. However, I believe 2.6.0.1 is wiping Dalvik properly even though sometimes it doesn't confirm it. Still think AR 1.8 is best recovery of all.
Click to expand...
Click to collapse
Thanks, it always prompts and it always confirms it's cleared. It just that the prompt page (Yes/No Page) sometimes takes a while and it's not doing anything between choose clear dalvik and the confirm page asking Are You Sure. You know, the Page where you have to push Down/Down/Down... and select. That page sometimes just doesn't pop up. But every other place that same confirm page pops up always comes up immediately. Just the Dalvik flavor of that confirm page is sometimes very slow to come up.
All I can think of is sometimes I just did Clear Data and Clear Cache just before and perhaps something needs to be rebuild before it can display that page. And other times I might do it in a different order. Say Dalvik first then the other clearing.
Just seems wierd and curious if others ever ran into it.
mswlogo said:
Thanks, it always prompts and it always confirms it's cleared. It just that the prompt page (Yes/No Page) sometimes takes a while and it's not doing anything between choose clear dalvik and the confirm page asking Are You Sure. You know, the Page where you have to push Down/Down/Down... and select. That page sometimes just doesn't pop up. But every other place that same confirm page pops up always comes up immediately. Just the Dalvik flavor of that confirm page is sometimes very slow to come up.
All I can think of is sometimes I just did Clear Data and Clear Cache just before and perhaps something needs to be rebuild before it can display that page. And other times I might do it in a different order. Say Dalvik first then the other clearing.
Just seems wierd and curious if others ever ran into it.
Click to expand...
Click to collapse
I experience the same thing. Sometimes it takes a bit to clear it and other times it doesn't. Depends on how long it has been since last change/wipe. With AR it gives the little progress dots and CW it doesn't so looks like it isn't doing anything when it actually is.

[Q] Deleting apps thoroughly

So I use Root Explorer to delete unwanted system files from /system/app and /data/app. After deleting the apk files, I noticed that there were still related files of the apps I deleted in /data/data (like com.htc.WeatherWidget) as well as in /data/dalvikcache/system, like @[email protected]@classes.dex.
My question is, what constitutes a thorough deletion of apps? I think merely deleting apk files in /system/app and /data/app is not enough, as I noticed a boost in free memory after further deleting in /data/data and /data/dalvikcache. Are there other directories to clean up?
I noticed also that wiping (and letting rebuild) Dalvik Cache after removing Large progrems frees up more memory.
Borat38 said:
So I use Root Explorer to delete unwanted system files from /system/app and /data/app. After deleting the apk files, I noticed that there were still related files of the apps I deleted in /data/data (like com.htc.WeatherWidget) as well as in /data/dalvikcache/system, like @[email protected]@classes.dex.
My question is, what constitutes a thorough deletion of apps? I think merely deleting apk files in /system/app and /data/app is not enough, as I noticed a boost in free memory after further deleting in /data/data and /data/dalvikcache. Are there other directories to clean up?
Click to expand...
Click to collapse
Some of apps has libs as well /system/lib, after cleaning up just reboot the phone and dalvik will setup on its own. try to look other q/a
davebugyi: You mean cleaning up Dalvik-cache from Titanium? Or wiping from Recovery? Or are are they the same thing?
kotag82: what do you mean by "q/a"?
Borat38 said:
davebugyi: You mean cleaning up Dalvik-cache from Titanium? Or wiping from Recovery? Or are are they the same thing?
kotag82: what do you mean by "q/a"?
Click to expand...
Click to collapse
I recommend to do it from recovery. On this is guaranteed, there are no processes which can block this cleaining.
Borat38 said:
davebugyi: You mean cleaning up Dalvik-cache from Titanium? Or wiping from Recovery? Or are are they the same thing?
kotag82: what do you mean by "q/a"?
Click to expand...
Click to collapse
No, not from titanium - I always do it from the recovery (if it's necessary).
davebugyi said:
I noticed also that wiping (and letting rebuild) Dalvik Cache after removing Large progrems frees up more memory.
Click to expand...
Click to collapse
True, true. I even downloaded 3 new games and a dictionary afterwards, and my phone idle memory, which used to be at 115-120Mb, shot up to 180-190Mb after I got rid of about a dozen system apps like Stocks, Weather, MagicSmoke Wallpapers, etc.
Thanks guys!

Insufficient Space/Invalid Package File

I've been having this issue for the past couple of weeks and I don't know how to resolve it. At first I thought it might have been my ROM so I wiped everything clean and flashed a new ROM but the problem still exists. I read on a forum that the cache partition could be full so I used Terminal Emulator to check the disk usage and I'm reading that my /cache is 98% full. I also have a dalvik cache in the cache folder as well as a dalvik cache in my /data folder both of which are close to 300mb in size. I tried to clear the cache and dalvik cache in recovery before resorting to the full wipe and each time both cache rebuilt themselves. I'm completely at a loss and I'd really appreciate some help with this issue. Thanks in advance.
So you're out of space? Perhaps you have several backups from CWM taking up all the room. They are pretty large files. I myself keep my stock backup and my most recent, the rest of them rest on my pc.
Sent from my Blazing ET4G
thats not the case here. i dug around a bit and saw that my cache and dalvik cache are 98% full. as stated earlier i tried deleting the dalvik cache but it regenerates itself. i looked around in titanium backup and saw an option to integrate some of the cache to the system. i enabled that and it moved around 150 items around and freed up some space. i'm still around 88% full and i know this problem is gonna rear it's ugly head very soon so I'm trying to install programs like link2sd and as2d+. none of these programs are working though...they all require partitioned sd cards (which i have) but none of these programs are seeing the partitioned card. i've tried repartitioning under recovery but that does absolutely nothing. anyway e4gt users can take advantage of these programs?
I had the same issue and it was driving me crazy. I just downloaded Cache Fixer and ran it and now I am good. Turns out my cache was 95% full, wiped it using that tool and I can now update and download.
I want to add that after it cleared, I could update but some of the other apps on the phone did no work (Google Music and Dolphin Browser to nae a few). I re-boot and the cache is back to pre clearing levels and no other issues. It does temporarily fix the isse bt I do not have a permanent fix.
If anyone has one, I would love to know what that may be.
i just want to say that I am having the same exact issue and performed the same steps the OP did. Only when I wipe the cache with cache fixer it everything forces closes so i can't update anything. So i am really stuck.
The only success that I have temporarily is uninstalling the app then resinstalling it. But thats not a permanent solution and sucks for apps like beautiful widgets.
PLEASE HELP
EDIT: on calkulins 3.0 rom and self updated google play

unable to format sdcard in cwm

I'm basically trying to move to the dalvik cache to my sd card for space reasons. I'm trying to format my sdcard for use with link2sd and other programs like it but I'm unable to do so in cwm. whenever i choose partition sdcard, it gives me the dialog like it does it correctly but nothing actually happens. I tried to partition the card on my pc but none of the link2sd programs recognize it. its as if the only thing those programs recognize is the internal storage and to my knowledge I can't do anything with that. if i can do it manually and avoid using the programs that'd be awesome. can anyone point me in the right direction?
...I'm kind at a loss for why you would want a virtual machine cache on an sd-card and not emmc. Perhaps I am 'not getting it'...care to explain?
i've had this problem for a couple of weeks now...downloads from the market over a certain size just won't go through. "insufficient space" "invalid package file" errors like those would pop up. i went to term. emulator and to check the mount sizes and my dalvik cache was 98% full. in titanium backup i saw an option to "integrate sys dalvik into ROM". i enabled that and it moved over 150 items from the dalvik to someplace in the system. that cleared up some space and now i'm only using 82% of the dalvik and i'm able to download and update from the market like normal. i know this problem is gonna come back and i'm trying to avoid it by moving the dalvik to the sd card where the space is plentiful.
hobomusashi said:
i've had this problem for a couple of weeks now...downloads from the market over a certain size just won't go through. "insufficient space" "invalid package file" errors like those would pop up. i went to term. emulator and to check the mount sizes and my dalvik cache was 98% full. in titanium backup i saw an option to "integrate sys dalvik into ROM". i enabled that and it moved over 150 items from the dalvik to someplace in the system. that cleared up some space and now i'm only using 82% of the dalvik and i'm able to download and update from the market like normal. i know this problem is gonna come back and i'm trying to avoid it by moving the dalvik to the sd card where the space is plentiful.
Click to expand...
Click to collapse
I've never encountered this problem...I flash like crazy...I also migrate over all of my apps via TB...so...I have like 4 or 5 phones worth of apps following me around from rom to rom.....I don't have many big apps, so, of course YMMV--and likely will--but....perhaps this isn't, in fact, the actual problem but a symptom of another problem.
Have you had this issue with multiple roms? When was the last time you did a full wipe? On every phone I have either the stock rom or my favorite rom that I always go back to, no matter what, more than any other rom.....via nandroid....and I have never encountered this problem....any other customizations we should know about?
I've never had this issue before. I'm on the latest Calkulin ROM since I've switched from my HD2. This is the first time I've had this error pop up and I resolved it by moving some things around in the dalvik and freeing up some space. As stated earlier TB moved around 150 items and afterwards I was instantly able to download/update from the market. I don't really customize my phone other than the random theming here and there. I've switched ROMs back and forth to see if it was in fact the ROM and not something I did but the issue came back as soon as I restored my backed up apps via TB. I'm guessing the cache filled up with the data from the apps that are backed up with TB.
Here's one solution/quick fix: manually delete your dalvik cache with a file manager and then just flash an odexed Rom: Then your space issues would be solved, and there's not the issue of Dalvik taking up any room in the first place.
["hip", "hip"]
mazook98 said:
Here's one solution/quick fix: manually delete your dalvik cache with a file manager and then just flash an odexed Rom: Then your space issues would be solved, and there's not the issue of Dalvik taking up any room in the first place.
["hip", "hip"]
Click to expand...
Click to collapse
...and I have always preferred odex'd roms. makes sense.
so there's no way of installing the programs mentioned in the first post?
CM supports init scripts, right? Download Calkulin's ROM from the Dev section, extract it and check system/etc/init.d for a dalvik2cache (going by memory here, might not be the exact name) script. Might be able to use that.
Sent from my SPH-D710 using Tapatalk

(INFO)The Wipe from Dalvik-Cache and Cache

By a boot of the Android OS itself looks the Dalvik (Virtual Machine) installed applications (. APKs.) Framework and files of the corresponding ROMs and builds a tree of their dependencies to the "framework" files. On this basis, the Dalvik optimized the code of applications and stores them in the Dalvik cache. (. dex). So 2 steps only tree, "unpack" and then optimize the information contained in applications. Dex files.
In ODEX-based ROMS (usually only the original Google ROMS) these optimizations are partially done already. "ODEX" files, it is split, the application sends and contained usually in the application. Dex file already is optimized apk beside the. Itself stored (. ODEX). But since this is more difficult to change, such as themes, etc, most of the FW / ROMS are not "odex'et", but "de-odexted", so really, the optimization undone. This does not affect the speed of the ROM itself, only on the first reboot this will take longer due to take the dalvik-cache these works must.
HOWEVER! the dalvik to be working in the current system (otherwise it would not be possible to install applications without a reboot of the reason stems from a myth:... Davilk works ONLY at Start-Up That is incorrect Thus: Once, either before boot, or anything in the current system (whether changes install, uninstall or deleted apps from the Dalvik is optimized and active / the respective. index deletes files in the cache.
The cache of dalvik "sits" in the User-partion of the OS (/ data). One exception is the "Memhack" This moves the Dalvik cache to the SD card to free up space in ROM memory shortage (we were only on some older phones still used as far as I know). I'm therefore "memhack" not work here.
So if you load a new Rome (for the Milestone: by flashing a "full" releases) or manually / data partion deletes (wipes) (PS: Wipe data and factory reset are 100% the same), then this cache completely removed (as part of the / data partition). Once the ROM is then booted the dalvik resumes his work, opens his Tree of dependencies, the optimized bytecode and backs it down a new dalvik cache under the previously deleted one and now newly created / data partition.
Optimize this always happens after every reboot! Manual intervention is actually NEVER necessary, because even if there are errors, they will be adjusted automatically by the dalvik, wrong. Dex files deleted etc etc.
Examples of myth:
- I wipe / data -> cache and all data gone
- I'm playing on a new ROM (full sbf) -> cache and off all data again
- I'll wait until the flash is completed, then I reboot and go into the recovery to the (delete dalvik for 3rd time I delete a data set does not exist yet.
These 3 actions to make 3 times the same.Weird,would think as a rookie, right? Correct, absolutely free of meaning and sense.
Therefore ...
- Every reboot the Dalvik cache is optimized. It is not present (our 3 examples), it is completely created (boot time is very long when the cache is created from scratch)
- In the current system works the dalvik and keeps the OS in optimal condition
- Even IF it should ever give errors (let's say I delete an APK in the recovery, or via update.zip or other (ie where all the dalvik is NOT active in the system), which takes place next reboot, and the optimized dalvik the system again without the necessity of Wiping the caches
Question:
does wiping harms the caches? No harm,he does not. But he does bring anything (except for special cases absolute). I have installed 100 determines Flashes behind me on the milestone, and certainly the 100 Nighltlies and ROMS on the Nexus. Not even I have deleted the cache or delete anything. The Android OS takes over completely without user intervention (except for absolute special cases that give its sometimes, but I have not even seen)
ITS NOT FROM ME,I HAVE ONLY TRANSLATED WITH GOOGLE!!!!
http://www.android-hilfe.de/2645790-post2.html
original link

Categories

Resources