After getting the "low on space" message on my Nexus One for the umpteenth time, I went to into the "manage applications" screen to uninstall applications I hadn't used recently. I waited for the screen to fully load before I did anything. It said I had 27MB free on my internal phone storage. I then clicked on the "Fooducate" app I had installed. It said it was using roughly 4.2 MB of my internal storage for the application, plus about 12 KB of data. It was installed on the phone and moving it to the SD card was not an option. I clicked "uninstall" and the uninstall process ran. After that, the "manage applications" screen claimed I had 28 MB left.

What happened to the other 3.2 MB? I would think that if you have 27 MB, and you uninstall a program that's using 4.2 MB of space, you would then have 31.2 MB of free space.

Update:

After turning my phone off and then back on again, and then going to the "manage application" screen, it now says 32 MB free, which is more like what I'd expect. So I guess my revised question is - why wasn't the space immediately available, and is there something I can do to free it without cycling the power?

2 Answers
2

From what I can make out from your scenario, it seems the culprit is the android's Dalvik Cache.
Quote from a thread in xda forums:-

When Android starts up, the DalvikVM
looks thru all of your applications
(.apk files) and frameworks, and
builds a tree of dependencies. It uses
this dependency tree to optimize the
bytecode for every application and
stores it in the Dalvik cache. The
applications are then run using the
optimized bytecode. This is why when
you install a new ROM, sometimes it
takes a very long time to boot for the
first time. Any time an application
(or framework library) changes, it's
reoptimized and the cache is updated.

I'm not too sure what relation there could be between the Dalvik cache and actual space on the internal application storage area. From what I've read the Dalvik cache uses its own partition.
–
jmbouffardJul 7 '11 at 12:48

@jmbouffard, a separate partition sounds rather impractical. How would it resize if necessary? How would you select a good initial size? Would make much more sense to me if it used the same partition as regular android allowing the user to get messages as you did
–
ChrisFletcherJul 7 '11 at 14:30

In my phone's recovery mode there is a "wipe cache partition" option that I associated with the Dalvik cache. But I've seen other references that states that the Dalvik cache is located in /data of the main partition. So it could be different from a device to another or I misinterpreted the cache partition mentioned in the recovery mode.
–
jmbouffardJul 7 '11 at 14:58

From my own experience I also noticed that, even without rebooting, the disk space would have been freed after waiting a little while. So my theory is that the Android OS distributes write operations to the internal memory in time to improve responsiveness of the device.

But the thing I'm still not sure is if the memory was needed right now to install a new application, would it be freed for that purpose or the "low memory" message would reappear until the deleted app gets its memory freed.