# Returning 575 Terabytes of Storage Space to Our Users

[Grab](https://yomu.fyi/company/grab) · Lucas Nelaupe · Feb 25, 2020

**Type:** Problem & solution

## Summary

Android Vitals data revealed that 15.7% of Grab users had less than 1GB of free device storage and uninstalled the app at 1.2 times the normal rate. To understand on-device storage consumption, the team instrumented session launches using the Android StorageManager API to collect binary size, cache folder size, and total footprint metrics. Analysis showed unusually large cache sizes driven by orphaned cache folders from discontinued third-party libraries, including an image library replacement of Picasso by Glide. An automated cleanup routine deployed in app updates purged legacy cache directories upon launch. This mechanism reclaimed 575 terabytes of junk data across more than 13 million devices, averaging 40MB per user.

## Context

According to Android Vitals, 15.7% of Grab users had less than 1GB of free storage on their devices and uninstalled the app 1.2 times more frequently than other users.

## Approach / What changed

Grab instrumented production storage measurements via the StorageManager API, identified orphaned cache directories left behind by removed third-party libraries like Picasso, and implemented an automatic cleanup mechanism in app updates to delete old cache folders upon launch.

## Takeaways

- Replacing or removing third-party libraries can leave unmanaged legacy cache folders on user devices unless explicitly purged.
- Using the Android StorageManager API during session launches allowed Grab to measure internal application binary sizes and cache consumption across production devices.
- Deploying an automated cache deletion routine reclaimed 575 terabytes of orphaned data across 13 million active devices.

**Tags:** [Android](https://yomu.fyi/topic/android), [Caching](https://yomu.fyi/topic/caching), [Observability](https://yomu.fyi/topic/observability), [Performance](https://yomu.fyi/topic/performance)

[Read original post](https://engineering.grab.com/returning-storage-space-back-to-our-users)
