e.g.: java.io.FileNotFoundException: /data/data/org.wikipedia/cache/journal.tmp (No space left on device)
from https://ticket.wikimedia.org/otrs/index.pl?Action=AgentTicketZoom&TicketID=8077275
Description
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | Dbrant | T87073 Out of space errors causing app to crash | |||
Resolved | • Mholloway | T89834 Limit the filesystem cache size of Picasso library. |
Event Timeline
This is coming up fairly often, e.g. https://ticket.wikimedia.org/otrs/index.pl?Action=AgentTicketZoom&TicketID=8091575
To me it looks like the most likely cause here is that the device is out of space to create the temporary file (journal.tmp) used in the process of compacting & rebuilding the cache's journal. When the app starts, it initializes the cache in the course of attempting to get the main page. It reads the journal, and if there's a problem, attempts to rebuild it using a sink that writes to a new journal.tmp file. The FileNotFoundException is thrown when there's no space available on the filesystem to create the new file. According to the guy who wrote DiskLruCache, the cache size limit (see T89834) doesn't apply to filesystem overhead or the journal file, so, as @Deskana said above, there appears to be little we can do.
There's very little that app developers can do (or are expected to do) when a device runs out of storage space. The Android OS itself will show warnings to the user when it's "close" to running out of space, which might prompt the user to delete unneeded apps or media. I believe the OS will also judiciously clear the cache of certain apps when storage is critically low. Either way, these are things we shouldn't be managing ourselves.