• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Root The Lag is Back

Everything in the Dalvik-cache will get automatically generated/re-generated either at boot-up or during an application install step. Deleting it doesn't do much because it comes right back on the next boot cycle.

eu1,

Just wanting a little clarification... I was a little confused by the above re. when (if) the Dalvik-cache gets generated or re-generated. Did you mean for an individual app or for the whole of the Dalvik-cache?

I ask this because I am running xtrSense 4.6.5, which of course uses cache2cache. When I booted it up from a powered-off state (its been off since last weekend), the boot-up took the "normal" time. I then checked the /cache/dalvik-cache directory and there were no files with a modification date/time of today and there were only a handful that even showed they were modified in 2011 (these appear to be apps that have been updated so far this year).

Anyway, I did a "wipe cache" in custom recovery and rebooted. The reboot took way longer than "normal"--i.e., what is customary when you've just freshly-wiped and did a new ROM install. Android was clearly rebuilding all of the /cache/davlik-cache .dex files. This time, there were nine files that showed a modification date/time matching the reboot time and a smattering of some of the 2011-modified files from the first boot (above). The rest of the files had the same modification date/time as before (i.e., whose .dex files match the modification date/time of the corresponding /system/app .apk files).

Is there something different about a cache2cache ROM in the way Dalvik-cache is handled or is this me just mis-reading your quote that was meant to reflect the Dalvik-cache behavior for an individual app?

Thanks and cheers!
 
eu1,

Just wanting a little clarification... (et cetera)

During boot Android performs a check of the normal application installation folders (/data/app, /system/app, et cetera) and makes sure there is a corresponding Dalvik-cache entry backing up each app (basically, an unpacked and optimized version of each .apk so they start and demand-load quickly when it is time to run them).

If the cache entry is already present, then no need to rebuild it, and this explains the "first boot" versus "thereafter boot" differences in start up time after "wiping" the dalvik cache location. In addition, if you install an individual app, or update an existing app, then those cache entries would need to be built/rebuilt individually at that time.

I believe that there are probably some other checks which take place at boot time - there is a system manifest at /data/system/packages.xml (which contains security certs, btw) and the apps, the dalvik cache, and this manifest need to be maintained in a coherent state. There may be both cryptographic and timestamp checks made to make sure that the cache is coherent after booting ... and also that no "funny business" occurred.

The fact that you saw old time stamps after you wiped the cache partition (and then rebooted) suggests that the Dalvik-cache creation process modifies file timestamps after it creates the Dalvik cache entries for its own purposes - I could speculate why it does that, but I don't know for sure.

(It is my impression that cache2cache is little more than a symlink from /data/dalvik-cache -> /cache/dalvik-cache, plus a little scriptware to move those files back and forth if you are turning it on or off - yes?)

eu1
 
Well now....I finally decided to get brave (and being shut in the house this weekend with outdoor temps of minus 25) I'd have a lot of time to play around. Decided to flash the Froshedyo Pink to play around with. Trying to download to my computer and it just goes to a blank screen. Can these now be downloaded directly to your phone? Or do we still download to our computer then copy the file over?
 
(It is my impression that cache2cache is little more than a symlink from /data/dalvik-cache -> /cache/dalvik-cache, plus a little scriptware to move those files back and forth if you are turning it on or off - yes?)

eu1,

Thank you for the elaboration...I appreciate it. I think I remember you posting something (somewhere) about the timestamps, timing, and conditions of the files and the creation thereof in Dalvik-cache, but I couldn't find it.

Yes, it does indeed seem that the brilliance of cache2cache lies in its simplicity. Here is the ls output showing the symbolic link:

Code:
[FONT=Courier New]# [B][COLOR=Blue]ls -a -l /data/dalvik-cache[/COLOR][/B]
[/FONT][FONT=Courier New]ls -a -l /data/dalvik-cache
[/FONT][FONT=Courier New]lrwxrwxrwx root   root  2011-01-22 13:55 [COLOR=Purple]dalvik-cache -> /cache/dalvik-cache[/COLOR][/FONT]

Not sure about the scripts, though...

Thanks again!
 
Well now....I finally decided to get brave (and being shut in the house this weekend with outdoor temps of minus 25) I'd have a lot of time to play around. Decided to flash the Froshedyo Pink to play around with. Trying to download to my computer and it just goes to a blank screen. Can these now be downloaded directly to your phone? Or do we still download to our computer then copy the file over?

Whichever one works. Be aware that lots of folks accidentally truncate their ROM files when they transfer them to the phone because they improperly dismount the SD card from the PC. After mounting to the PC and copying the file:

- wait a little bit, say 30 seconds or thereabouts
- Use the "Safely Remove Hardware" control in the (Windows PC's) system tray
- wait for the little balloon to pop up that says "Safe to Remove Hardware"
- turn of the export of the SD from the USB notification pull-down on the phone

If you download directly to the phone, the file will end up in /sdcard/downloads, so you would need to move it to /sdcard before you flash it with Amon_RA. (In ROM Manager/ClockworkMod you can browse for it).

Make sure to make a Nandroid backup of your current ROM before you begin, and also it is wise to perform a "signing check" verification on the downloaded file to make sure that it did not get truncated on the download or transferring it from the PC. You can do this with scary alien's free market app "AFV (Android File Verifier)". Even if you don't know the MD5 signature of the file, you can do an integrity check on the .zip file using the "Verify jar-type file" - it is impossible for a corrupted .zip file to pass that test.

good luck
 
For froyo do this

Install this: [SCRIPT][1/22/2011] BETA Simple Froyo Cache2Cache - xda-developers so you have the neccessary space and dont fill it to the rim with apps (hard to do once you install this and move appropriate apps to SD card)
Plus this: Cache Cleaner NG from the market
Plus: Autokiller set at minimum strict (mines at aggressive)
Plus: setcpu or cpuboost (same thing) to on demand for main profile. use smartass governer on your SCREEN OFF profile only so it does the battery saving thing

If you still have lag get a new rom or new phone.
 
For froyo do this

Install this: [SCRIPT][1/22/2011] BETA Simple Froyo Cache2Cache - xda-developers so you have the neccessary space and dont fill it to the rim with apps (hard to do once you install this and move appropriate apps to SD card)

I am running this as well and it's fantastic. One of the reasons I was going back to 2.1 ROMs was the xtr-based ROMs support of cache2cache - I was always on the edge of running out of space on 2.2 ROMs.

Just know this: if you are depending on this cache2cache on Froyo, remember to re-flash this right after you flash an update to the ROM before you restart the phone. Flashing a ROM update will remove the script that moves the cache mount point.
 
Back
Top Bottom