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

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

Status
Not open for further replies.
Afteraffekt,

I hope your response was sarcasm because I was resonpding to what FalconFour said about me not using many apps or knowing how to hack an android phone. I was in no way putting down any of the developers.

Guess I should have quoted the response I was responding to so that my intentions were more clear.
 
Upvote 0
. 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?


I really do appologize if this comes out wrong, but you REALLY, REALLY, REALLY dont get it, So, im gunna say this slow.


YOUR
DALVIK CACHE
DOES
NOT
GROW
UNLESS
YOU
INSTALL
APPLICATIONS!
 
  • Like
Reactions: inception
Upvote 0
Uhmmm, I hope this is sarcasm because this was a response to what FalconFour said about me not using many apps or knowing how to hack an android phone. I was in no way putting down any of the developers.

Guess I should have quoted the response I was responding to so that my intentions were more clear.

Oh. Haha, I just read a few posts up, and realized it. My bad.
 
Upvote 0
Almost everything you talked about in your "google search research" about dalvik cache was relating to clearing dalvik to install a rom, or moving it for internal space.. None of it says dalvik is flawed.

Your bottom of the barrell android phone =/= Android OS... I think maybe this is the confusion were having Falcon.

I have well over 100 downloaded apps. I've moved dalvik cache to /cache, and my cache partition has grown from 80 mb to around 100 mb since I flashed a new rom.

And I guess I'm in disneyland too, my phone doesn't have force closes or lag either.
 
Upvote 0
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.

(I'll ignore the part about unused apps since I already went over uninstall != removes dalvik-cache entry...)

So, you're saying... you... have to go into recovery... and wipe Dalvik-Cache...

...

AND THIS IS "STOCK BEHAVIOR"?! That's the ENTIRE RANT of this topic... that you have to root your phone and perform very non-standard operations in order to maintain any level of sanity in the data department. A normal user, one who installs as many apps as the phone can hold, will not be able to use all their storage since D-C is needlessly wasting all their storage and they can't clear it. Myself, I KNOW about wiping Dalvik-Cache, that was half the point of OP. I've done it, it freed up a crapload of valuable space. But the fact is that it does NOT maintain itself, it requires someone to manually (and "un-supportedly") completely wipe the cache in order to regain the space wasted by the cache's unused files. There's the rant. Can you address that?
 
Upvote 0
(I'll ignore the part about unused apps since I already went over uninstall != removes dalvik-cache entry...)

So, you're saying... you... have to go into recovery... and wipe Dalvik-Cache...

...

AND THIS IS "STOCK BEHAVIOR"?! That's the ENTIRE RANT of this topic... that you have to root your phone and perform very non-standard operations in order to maintain any level of sanity in the data department. A normal user, one who installs as many apps as the phone can hold, will not be able to use all their storage since D-C is needlessly wasting all their storage and they can't clear it. Myself, I KNOW about wiping Dalvik-Cache, that was half the point of OP. I've done it, it freed up a crapload of valuable space. But the fact is that it does NOT maintain itself, it requires someone to manually (and "un-supportedly") completely wipe the cache in order to regain the space wasted by the cache's unused files. There's the rant. Can you address that?

Well, that sucks for you, if you don't have your phone rooted, BECAUSE GOOGLE NEVER INTENDED FOR IT'S DAMN USERS TO HAVE THEM ROOTED. It isn't that complicated. Now, if they DID want them to have it rooted, it may be a different story, due to the fact that they would have the ACTUAL ABILITY TO CLEAR IT. There are limitations in the Android system, and your going to have to learn to accept that.
/facepalm
 
Upvote 0
I seriously just read the last few posts, tossed my empty soda cup backwards, and simply said out loud, to my computer,

"What the f*** is wrong with these people?!"

Please? Please? Please someone tell me... what... where... can we please get in a Skype chat or something? Something non-text based? Video chat? I can host it. I just don't get it. Maybe we're hitting a communications gap here. This just doesn't make any sense. I don't get it at all, how are you all missing the point? How are you all so vehemently denying the existence of this flaw? It's sitting right there, you're even confirming it by even talking about rooted phones or clearing the D-C folder... I'm just...

DUMBFOUNDED!

Skype group audio chat. I'm all for it. falconiv. I'm online. Please, this is insanity!
 
Upvote 0
(I'll ignore the part about unused apps since I already went over uninstall != removes dalvik-cache entry...)

So, you're saying... you... have to go into recovery... and wipe Dalvik-Cache...

...

AND THIS IS "STOCK BEHAVIOR"?! That's the ENTIRE RANT of this topic... that you have to root your phone and perform very non-standard operations in order to maintain any level of sanity in the data department. A normal user, one who installs as many apps as the phone can hold, will not be able to use all their storage since D-C is needlessly wasting all their storage and they can't clear it. Myself, I KNOW about wiping Dalvik-Cache, that was half the point of OP. I've done it, it freed up a crapload of valuable space. But the fact is that it does NOT maintain itself, it requires someone to manually (and "un-supportedly") completely wipe the cache in order to regain the space wasted by the cache's unused files. There's the rant. Can you address that?


Pretty sure a "normal user" won't really care.
 
  • Like
Reactions: inception
Upvote 0
Well, that sucks for you, if you don't have your phone rooted, BECAUSE GOOGLE NEVER INTENDED FOR IT'S DAMN USERS TO HAVE THEM ROOTED. It isn't that complicated. Now, if they DID want them to have it rooted, it may be a different story, due to the fact that they would have the ACTUAL ABILITY TO CLEAR IT. There are limitations in the Android system, and your going to have to learn to accept that.
/facepalm

I'm almost in tears here... THAT'S THE FRICKIN' POINT! Not intended to be... I... just... YES! DUH! I... how are you...

*crying*

It's not April 1 yet... why are you all doing this to me...
 
Upvote 0
I seriously just read the last few posts, tossed my empty soda cup backwards, and simply said out loud, to my computer,

Ok, I see the problem now.

Go outside and have this conversation with a real person. If they agree with you, come back and start spouting more nonsense.

But so far its you and your computer on one side, and the rest of the world on the other... Maybe you should ask the computer what's wrong with you instead of everyone else?
 
  • Like
Reactions: j2cool2012
Upvote 0
I'd love to see your response to savoxis first post cause it makes 100% sense to me. ;)

Done! Looking it up now. I'm just so... completely flabbergasted here. I don't get where the point is being missed. Everything I wrote up is inherent to every Android phone using Dalvik-Cache... and no point of it is subject to rooting or user preference or misuse or anything... it's just standard (and completely insane) behavior... and I'm just completely lost as to how people are completely, totally, entirely missing the point. I'm dying here, I'll go for anything. Gimme a few, I'll go over that post...
 
Upvote 0
But the fact is that it does NOT maintain itself, it requires someone to manually (and "un-supportedly") completely wipe the cache in order to regain the space wasted by the cache's unused files. There's the rant. Can you address that?

If your dalvik-cache is "out of control" and "growing on its own" YOU my friend are doing something wrong.

Dalvik-cache only gets larger when you install apps.

Ill say it again incase you missed it

Dalvik-cache only gets larger when you install apps.



Now.

Are you absolutely sure your not a moron? Are you sure that its not your cache partition getting full due to downloading a bunch of OTA content with my script and not clearing?

Are you sure that you are not manually removing applications so the dalvik-cache's dex's stay?

Are you sure that you dont have some unique android virus creating things in your dalvik-cache?

Would you like to pay me to write you a useless script that will monitor your dalvik-cache and clear out "outdated" dex files?



IF this was necessary I would have written a solution. And by that logic I > Google's Developers. So do you really think that if I could make an init script to manage dalvik they would not have?
 
Upvote 0
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
OK, so explain to me how Android reads minds and knows what I intend to do when I press "Home"? Far as I can tell, it understands "bring home to foreground", and that's it. The rest is up to the built-in task handler. Which means, what if I'm running Pandora? It keeps that app running in the background so it plays music. Cool. What if I'm loading a page in the browser? It... well, I half-expect it to stop loading. But maybe it continues loading. Maybe running a download. What about sending an SMS? It lets it keep sending. Cool. All functioning as intended. Now, what about some misbehaving app? Something that demands too much OS attention, more attention than I want to give it (personally)? Something I just one-off launched, didn't like, now "go away"? It keeps running. It'll keep running, too, if it wants to keep polling a network resource for updates. Or wants to keep monitoring for input. So, say I started running some Twitter app, and signed in. Bleh, I don't like twitter, I go back home. It keeps running. Facebook. It keeps running, polling, waking the phone to do its updates. It doesn't go to sleep, it doesn't yield to other apps, unless I open another huge app like Angry Birds. How does Angry Birds know if I want to pause the game for a quick detour then get right back to it, or if I'm done playing and want to exit? None of that stuff can be known without reading my mind. None of that stuff can be relayed to the task handler without a task killer, a way for me to say "I'm done with all that other crap, clear your mind and let me take control".

Dalvik-Cache:

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.
True in terms of how the cache works. Not so true in terms of its flaws. In my use, D-C has always left "dex" (I'm assuming - I haven't cracked up my cache folder in a while) files laying around even when the app is uninstalled via Market, or via Manage Apps. I've NEVER removed an app by deleting it via root methods. Ever. Except the ones removed via Velocity's script (removing unwanted system apps). I'm not counting those files. I'm talking about the fact that D-C never prunes itself, never maintains itself, never removes old and unused cache files (old app versions, unused apps, etc), and just keeps growing. It grows to over 70% of the size of the user data partition, which is... well... supposed to be for user data. Dalvik-Cache is a system function, and in fact, it's a cache function... so that poses two questions: 1) why isn't it stored in CACHE, like its function implies? And 2) Why doesn't it maintain itself?

I'm a little curious by the comments that uninstalling an app also deletes its cache entry, though. Obviously my phone wasn't doing that (UNrooted, UNmodified). And it was doing that routinely, even after factory-restores. That can't possibly be normal behavior. OK, so uninstalls may clear the related dex files, but what about updates? The cache would be different, does it delete the old cache file? It's so rare that a cache file is deleted... has anyone even done any research into how the folder's contents change when an app is updated, not just uninstalled?

Hopefully the "OMG troll?!" comments have come to an end, though... they're really just confusing the hell outta me. I'm on your side here, guys... only thing I'm trying to contribute here is a concrete problem, and working to present a solution... I don't get why everyone is denying the very existence of the problem itself. :thinking:
 
Upvote 0
If your dalvik-cache is "out of control" and "growing on its own" YOU my friend are doing something wrong.

Dalvik-cache only gets larger when you install apps.

Ill say it again incase you missed it

Dalvik-cache only gets larger when you install apps.

Now.

Are you absolutely sure your not a moron? Are you sure that its not your cache partition getting full due to downloading a bunch of OTA content with my script and not clearing?

Are you sure that you are not manually removing applications so the dalvik-cache's dex's stay?

Are you sure that you dont have some unique android virus creating things in your dalvik-cache?

Would you like to pay me to write you a useless script that will monitor your dalvik-cache and clear out "outdated" dex files?

IF this was necessary I would have written a solution. And by that logic I > Google's Developers. So do you really think that if I could make an init script to manage dalvik they would not have?

Just to respond to this post: I covered a lot of this in my latest reply. But to individually address in brief:
- No, it also grows to create cache files for apps built into the system, so as those apps are launched the Dalvik-Cache will also continue to grow with no apps installed. After all, the Dalvik-Cache needs to create a dex for every apk in use, so as system apk's are launched, a dex file will be created as well. Sadly, none will be deleted even if you never touch that app again.
- absolutely sure I'm not a moron? Yep, pretty sure. I've lived with my Ally for almost a year now, and I've studied its behavior, as well as contributed to revealing a few other UI flaws in Android that just make for a "rough around the edges" experience. Things that slipped through the cracks, but should be easy to fix - some of which have been since I posted them.
- no, I'm not manually removing APKs - the dex files just linger around, but at any rate there's no reason 25mb of apps should ever create 80mb of Dalvik-Cache.
- I'm tempted to take you up on the dalvik-monitoring script, but the fact is, I know how to clear my D-C... it's just something I shouldn't have to maintain myself. It should have limits.

edit: also...
- yes, I do believe Google overlooked Dalvik-Cache maintenance entirely, and that's the point of this topic. Yes, D-C serves a purpose, but it runs in a "free-wheeling" mode that allows it to balloon to ridiculous sizes, eclipsing the apps it's supposed to be serving (caching). That's what I'm ranting about in this topic, that after all these Android versions, D-C is still as flawed as it was from the start, with no oversight and no management to keep it in "cache" terms... to keep it from taking over the whole /data partition. How big is your Dalvik-Cache, compared to the apps folder?
 
Upvote 0
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

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.

[/rant]

edit: and don't even get me started on people that actually trust Android's background-task manager and say you "don't need a task killer"... ahahahaha. Dalvik-Cache is proof of Google's resource-management negligence here, so you can't possibly tell me task killers aren't necessary.





Really ?
Personally I just think your stupid
2nd:I know how to solve you your problem and ours
1.Go to your profile
2.Logout
3.Go to your browser settings
4.Go to Browser history
5.CLEAR/DELETE Browser history
6.NEVER COME BACK HERE again

Now if you are following these steps it well help a lot of people
 
  • Like
Reactions: j2cool2012
Upvote 0
Now, what about some misbehaving app? Something that demands too much OS attention, more attention than I want to give it (personally)? Something I just one-off launched, didn't like, now "go away"? It keeps running. It'll keep running, too, if it wants to keep polling a network resource for updates. Or wants to keep monitoring for input. So, say I started running some Twitter app, and signed in. Bleh, I don't like twitter, I go back home. It keeps running. Facebook.
Dont use improperly coded applications, your right they are out there, but that isnt androids fault, they have throughly documented how to write applications that conform to the lifecyle.

As for applications like Twitter and Facebook, well first let me just say, if you run a task killer and see apps "running" that doesnt mean they are in the Foreground or Service lifecyle. Applications that are suspended will also show in this list, that DOESNT mean they are eating up resources. Anyway, applications like twitter and facebook are written correctly so they are suspended when not in use, they will come alive to sync if they are in the background, but you can easily turn this off.

And I answered you dalvik concerns a few times.


As much as I would like to continue this class, I am done feeding this fire and have much more productive things to be doing. Im sorry you are confused and dont understand how things work. I tried to help you but you obviously have formed your own concepts and ideas of how these things work.
 
Upvote 0
Still doesn't address the issue of "not being able to read my mind"... actually it doesn't address anything I even mentioned. I'm not forming my own concepts and ideas here either... it's pretty easy to "ls -l" the data/dalvik-cache folder and see what's left behind in there.

Maybe I'm just writing too many words, people are just skimming?

Either way, I'm starting to "report" posts that are just abusive spam (like "never come here again")... at least I have some level of defense against this insanity...
 
Upvote 0
Dont use improperly coded applications, your right they are out there, but that isnt androids fault, they have throughly documented how to write applications that conform to the lifecyle.

As for applications like Twitter and Facebook, well first let me just say, if you run a task killer and see apps "running" that doesnt mean they are in the Foreground or Service lifecyle. Applications that are suspended will also show in this list, that DOESNT mean they are eating up resources. Anyway, applications like twitter and facebook are written correctly so they are suspended when not in use, they will come alive to sync if they are in the background, but you can easily turn this off.

And I answered you dalvik concerns a few times.


As much as I would like to continue this class, I am done feeding this fire and have much more productive things to be doing. Im sorry you are confused and dont understand how things work. I tried to help you but you obviously have formed your own concepts and ideas of how these things work.

Still doesn't address the issue of "not being able to read my mind"... actually it doesn't address anything I even mentioned. I'm not forming my own concepts and ideas here either... it's pretty easy to "ls -l" the data/dalvik-cache folder and see what's left behind in there.

Maybe I'm just writing too many words, people are just skimming?

Either way, I'm starting to "report" posts that are just abusive spam (like "never come here again")... at least I have some level of defense against this insanity...

Okay, I would just like to ask you, one more time, please state what you would like us to address.
 
Upvote 0
Status
Not open for further replies.

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones