Dalvik-Cache: Fatal design flaw or just boneheaded oversight?

Thread Status:
Not open for further replies.

Last Updated:

  1. FalconFour

    FalconFour Well-Known Member

    Okay, I really, just have to vent about this. Somehow, in the Google-perceived history of the internet, nobody has ever actually labeled the Dalvik-Cache system/folder/"bug" as a fatal design flaw in the Android architecture? Really? It's pretty obvious in my opinion...

    Think about it. Dalvik-Cache is a folder that:
    • is at least 1.0 times the size of all installed APKs (often more than 1x, as below)
    • does not get cleaned-up - EVER - by the Android OS
    • is transparent to the user, just mysteriously consuming space on the phone
    • lives in the USER data structure (on-phone storage), instead of on the cache partition
    • has absolutely no facility for any utility apps, or for the user, to clean up the mess in the folder
    • can only increase in size, since if an app is uninstalled, its corresponding (and equally large) dalvik-cache entries do not get erased

    (EDIT: Please jump to THIS post: http://androidforums.com/2476499-post69.html to see where we stand in this discussion at the moment)

    It's just mind-bogglingly ridiculous... especially on as hardware-limited phone as the Ally, I would expect (not just "hope") that a folder titled "cache" of any kind would have limitations imposed on it. To have the effect of hardware limitations be "slower performance", i.e. the phone would have to re-generate Dalvik-cache entries for rarely-used apps it had to prune-off due to imposed cache limitations... that would make sense. But no... it has no limitations, and very frequently overruns the amount of storage available to the user.

    Before I rooted, I found myself constantly out of storage, with a small number of apps installed. It didn't make sense... it first occurred to me when I worked to manually tally up the reported amount of storage each app took up. The amount totaled up to about 25MB for all my apps. So why, if I have 150MB of storage, do I have 15MB free? I found it: 80mb in Dalvik-Cache, and the rest is app data. WTF? 80MB of cache for 25mb of apps? Cache - that is, something that can be re-generated with zero penalty of lost data? Can we be serious here? Why isn't this cache being maintained by the OS? Why is it permitted to balloon to 75% of user-data space, completely unchecked? And no way to clear it, without erasing all data by doing a factory reset. So it's a ticking time-bomb that will eventually fill the device's onboard memory even with no apps installed (all uninstalled).

    I understand the purpose of Dalvik-Cache. To place an optimized, compiled copy of the apps that run on the Android OS. That makes sense. But with there being no maintenance of this folder, free-wheeling in the same way as MSIE's "Temporary Internet Files" folder (which has obscene limitations and often stores upwards of 30,000+ useless, outdated cache files with little to no maintenance, and is often the source of computer slowness on IE-users' systems)... it's an OBVIOUS design flaw that really should have been caught and fixed before Android even made it into production.


    edit: Final statements on this wildly out-of-control discussion: http://androidforums.com/lg-ally/30...-just-boneheaded-oversight-2.html#post2476584


  2. BugsyM

    BugsyM Active Member

  3. j2cool2012

    j2cool2012 Well-Known Member Developer

  4. FalconFour

    FalconFour Well-Known Member

  5. j2cool2012

    j2cool2012 Well-Known Member Developer

    No... NOT really.:mad:
  6. FalconFour

    FalconFour Well-Known Member

    Well aren't you being helpful! Thanks for your insightful contribution to the topic. :D

    ( Sarcasm self-test complete, you may now exit the topic. )
  7. flyinjoe13

    flyinjoe13 Well-Known Member

    Task killers aren't necessary.
  8. FalconFour

    FalconFour Well-Known Member

    Is that all this forum is good for? One line trolls? Well, here's my contribution: "yes they are" :rolleyes:
  9. Afteraffekt

    Afteraffekt Well-Known Member

    Dalvik cache is what holds all installed apps so the OS can run them, it opens the apk and runs it like an executable, and runs from there, its not a flaw, and isnt a problem, Dalvik cache is a genius idea, and is even being adopted by Blackberry in their OS5
  10. flyinjoe13

    flyinjoe13 Well-Known Member

    I have 383 posts to your 26 and i'm a troll?

    But back on point....if you want to believe they are, more power to you, but the fact remains that they are not necessary. Necessary implies my phone wouldn't run without one, but my phone has run just fine without one since the day I bought it.
  11. Goonie21

    Goonie21 Well-Known Member

    This is not windows.
    it doesn't matter how much stuff is running in the background your phone wont slow down. Task killer interferes with automatic updates and email.
    Trident likes this.
  12. jcase

    jcase Well-Known Member

    Isn't a little early for April Fools jokes?
    Trident likes this.
  13. FalconFour

    FalconFour Well-Known Member

    Well, like I said, I understand the function of Dalvik-Cache. Did you actually read the post and what's wrong with the cache, or are you just sponsored by Google to cover up the flaws with "as-designed" tags? :rolleyes:
  14. FalconFour

    FalconFour Well-Known Member

    Christ, people, is this whole forum sponsored by Google, or what? Yes, it does slow down (and crash) the phone... not to mention untold numbers of unwanted partial-wakeups caused by unwanted applications that can only be truly CLOSED with a task-killer... Android does a piss-poor job of managing tasks, plain and simple. It keeps all available RAM occupied by unwanted apps in their current state, so if--... wait, are we seriously launching into this debate? No, screw that, this topic is about dalvik-cache. Can you debunk a single one of the flaws in OP, or are you just rambling rambling rambling about stuff you haven't actually researched?
  15. Trident

    Trident VIP Member VIP Member

    Where, pray tell, is YOUR research?
  16. Goonie21

    Goonie21 Well-Known Member

    I have never had a problem without using a task manger, And there is nothing wrong with Dalvik cache at all.
  17. flyinjoe13

    flyinjoe13 Well-Known Member

    Going by your logic that anyone who defends Android is sponsored by Google, I guess that means you are sponsored by Apple. So if that is the case, what are you doing here?

    But back on point again.....my phone has never slowed down. My phone has never FC'd. My phone has never partially woken up by an unwanted app. And oddly enough, I don't have a task manager. How can that be????
    death2all110 and Trident like this.
  18. Trident

    Trident VIP Member VIP Member

    On the task killer subject.. please refer to this article. You are terribly misinformed.
  19. Afteraffekt

    Afteraffekt Well-Known Member

    YOu do realise that theres 40 apps on your phone that you dont see? yea, go on sir
  20. death2all110

    death2all110 VIP Member VIP Member


    Sorry. Had to.

    But are you serious?

    This isn't funny guy. Its only the 24th. Come back on the 1st, maybe?
    j2cool2012 and Trident like this.
  21. FalconFour

    FalconFour Well-Known Member

    No, not anyone that defends Android. I do it all the time. Just anyone that completely ignores the matter in the topic and pounces on one "by the by..." line. That's pretty trolly IMO. I think Android kicks Apple's ass in most areas. But there are these glaring design flaws that just make me wonder "who was responsible for this aspect, and were they sacked yet?".

    "My phone has never slowed down... never FC'd... never partially woken up" - alright, let's go through these completely Disneyland statements, shall we?
    - never slowed down: OK, so you can seriously tell me that you hold a stopwatch to your phone ever time you tap one of your apps? o_O OK, I didn't think so. Disneyland #1 gone.
    - never FC'd: I can almost believe this one, so this Disneyland can stay. You must not use many apps or do much hacking.
    - never partially woken up: You can't even test this. I haven't yet seen a debug app that logs every partial wake-up event (that happen numerous times every hour). And for that matter, if it's never partially woken-up, then you must not be receiving any email or alarm notifications, or incoming phone calls, or text messages, or... [...] ... you see the point here? Partial wake-ups are things apps do to collect data and update their state, set off alarms, notifications, etc. It happens all the time, and it happens in excess for unwanted running apps (i.e. Amazon MP3, voice search, etc). Task killers close these programs unless they're wanted.

    And task killers can be configured to ignore apps you DO want - for example, I want my Handcent SMS and TouchDown mail client to stay open when I do the (admittedly rare) "end-all" function. But I do "end-all" to clean up wasted memory, which always stays at 100% utilization until I close the background clutter that collects over the days. Task killers are practically a necessity due to the inability to signal to the OS that "I'm actually done with this app, it can go away now". Otherwise it says "dormant", unknowing that I'm done using it, unsure if I'll want to use it again.

    Now, about that Dalvik-Cache thing. Strange, I'm getting a pretty huge deja-vu vibe from this topic... as if we've been here before. o_O I've gotta wonder, you're right, it's not April 1st yet, so how the hell are you all completely missing the point and acting like "the counter-point is obvious"... like, that the supermassive Dalvik-Cache folder eating up 75% of your phone storage is somehow a non-issue? *uber confused*
  22. Trident

    Trident VIP Member VIP Member

    That super long message is cool and all, but I'm still waiting on your proof and research.
    McLovlein13 likes this.
  23. flyinjoe13

    flyinjoe13 Well-Known Member

    I use plenty of apps, but I don't keep unwanted apps on my phone so maybe you are the one who needs a lesson in hacking if you still have them on your phone. I have removed or frozen all of those unwanted apps ages ago. It's a pretty simple thing to do so instead of complaining about how you need a task manager to kill all of them, why don't you do some research (since you seem to be so fond of doing reasearch) on how to remove them.

    As for why the dalvik cache eating up 75% of my storage space is a non-issue, that's easy. I take 10 seconds out of my day if I have been installing\uninstalling apps, go into recovery and wipe the dalvik cache. Problem solved. If that is such a big hassle to you that it requires this meaningless rant about dalvik cache, then I think you are the one with the problem, not us.
  24. savoxis

    savoxis Well-Known Member Developer

    Let me clear up a few things here.

    Task Killers:

    The Android task killer handles all applications life cycles, when an application in in the Foreground it takes priority over all Background applications and services, allowing it to have the resources needed to operate. Google setup the lifecycle for applications with performance in mind, it allows for an application not being used to be classified as a empty process, storing it in cache (not ram) so it can be called back up to the same screen it was on when it whent to an empty process, when you are not using an application it doesnt take any of your ram, or (very many) processes, or even very much space
    When you use a task killer the android system will often try to get the application that it had "stowed away" back and in doing so it will will bring the application to a higher level in the lifecycle, thus using more of your ram and proc, thus eating your battery.
    Basics of Android Development : Android Application Lifecycle | Android Competency Center


    For those not familiar with java, it is a cross platform language, and android devices are all different platforms due to vastly differing hardware and software versions. When you fire up your phone for the first time, or install an application the system compiles each application into executable code for your device. This is necessary. And due to the nature of java, the dex files created are often larger than the application.
    When you uninstall an application thru the Android OS, it removes the dex file, the data, and the apk.
    When you uninstall an application by just removing the apk, you still have the dex, and the data.
    The only time your dalvik-cache will be incorrect is when you manually remove apks without removing the others. And ofcourse since android phones ARE NOT ROOTED the folks at google obviously realized that there is no reason they should have this location monitored, or cleaned. Since. You dont need to rebuild the dalvik for an application-the executable code will never have to be changed for your platform.
    This being said the only reason you would have to manipulate your dalvik-cache is when you have been doing things that you technically should not do.

    If you take away anything from this please remember:
    Dont go wiping your dalvik a bunch thinking it will improve performance.
    Only wipe your dalvik if you have MANUALLY removed applications
    Task killers will eat your processes and visa vi your battery.
  25. FalconFour

    FalconFour Well-Known Member

    Hey, I've got teh uber respect for you and all the work on Velocity (which has saved my phone from being frustratedly snapped in half a few times now)... using v1.0 now, and the "move Dalvik-Cache to cache partition" function has saved my phone from one of the aforementioned snapinhalf moments ;) I seriously do not take lightly to my phone telling me it's out of storage when I have very few apps installed (compared to what I've seen on other phones), and moved most of them to SD... so that "move" function is a lifesaver. No bugs so far either, no FCs or hangs. You've done some great work there :)

    ... Which makes me wonder why you're missing the point, or even questioning this? All the research and proof is laid out in the original topic... it's pretty common knowledge that Dalvik-Cache is an unmanaged, runaway mess, with the mere Googling of "dalvik-cache" resulting in pages of "oh, have you tried clearing Dalvik-Cache?"... "clearing dalvik-cache is harmless, just reboot"... or, hell, let's just run that search now, why don't we?
    "[How to] Clear Dalvik Cache" ... "What exactly is the Dalvik Cache and when do I need to clear it?" ... "Clear Dalvik Cache - xda-developers" ... "it seems like my internal memory /data is declining, though bit by bit (im using apps2sd). it was recently 84mb free but now just 75mb free" ... "Just wondering because i always see it during my nandroid backup and usually takes the longest"...

    Seems pretty common knowledge to me, which stumps me as to why all the folks in this topic so far are completely... and I mean completely... dodging the entire issue. Do you guys somehow think I'm an Apple fanboy bashing one aspect of Android in order to belittle the whole platform? No... I'm just ranting about one poorly-conceived aspect of the OS. I think it's pretty common knowledge that Dalvik-Cache consumes way more storage than is appropriate for its function... I mean, if I could say "limit Dalvik-Cache to 25% of storage", and it would prune off the unused app cache files... that would make sense! I would want it to remove the cache files for apps I never touch, the preinstalled ones, or the apps I only use every now and then (like Terminal Emulator - I only use that when I have a problem I want to solve, certainly not every day, necessitating a persistent cache file!). That is the way I'd think cache would be implemented. It would just create a cache file when it notices one isn't there, and only store "X-amount" of cache files, deleting the least-recently-used one when it needs more room. Makes sense, right?
Thread Status:
Not open for further replies.

Share This Page