Page MenuHomePhabricator

Out of space errors causing app to crash
Closed, ResolvedPublic

Description

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

Event Timeline

Krenair raised the priority of this task from to Needs Triage.
Krenair updated the task description. (Show Details)
Krenair subscribed.

It's possible that this was fixed due to our work on T89826, but actually @Dbrant is sceptical that these errors are actually due to the device being out of space. Either way, there's a limited amount we can do.

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.

Dbrant changed the task status from Open to Stalled.Apr 29 2015, 2:03 AM

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.

Dbrant claimed this task.

Seems to have stopped happening.