Updates API / OTA : Android disk usage grows with each OTA update
See original GitHub issueEnvironment
Any Expo app.
Steps to Reproduce
- Create an Expo app and publish it to the app stores.
- Install the app on your device.
- Publish OTA updates for your app.
- View the app memory footprint on the device before and after the update.
Expected Behavior
Previous (stale) JS bundles are cleared from the device after a new JS bundle is loaded over the air.
Actual Behavior
All prior JS bundles remain on device, this causes the app’s memory usage to grow over time, increasing with each OTA release. For instance, here is the progression of the data reported by Android for our staging app from a fresh install through 3 OTA updates (each update was the same code, just published again):
Fresh install: 32KB
1st OTA update: ~ 8.8MB
2nd OTA update: ~ 12.5MB
3rd OTA update: ~ 18.24MB
Extra Info
I first reported this yesterday on the Expo Forums and was recommended to open an issue here. Previously, our team had assumed Expo apps would keep only the current JS bundle saved on the device, but it appears all downloaded JS bundles remain saved on the device.
This creates a scenario where an app’s memory footprint on a device grows over time, increasing with each OTA update. For JS bundles that are 1-5MB, this could result in app sizes which take up 100s of MB after many updates are pushed. Because of how easy it easy to publish updates OTA, this is a realistic possibility, but very problematic for users and developers if the app size gets to be this large. We first noticed this looking at our staging build (which we publish frequently) which was taking up 200-300MB in total size.
Questions
- Our team has demonstrated this behavior on Android, but not yet on iOS. It’s unclear to me right now if this behavior is the same on iOS or not. Update: I’m pretty sure this does not happen on iOS.
- We have not tested yet to see the result if we push new binaries to the App Stores. If pushing a new app binary and updating it clears the extra JS bundles, then this is reasonable to workaround for now because we expect to be building new binaries every 1-3 months or so to keep up with Expo SDK releases.
- It would be great if Expo could clear stale JS bundles after loading a new OTA update, or, provide some API where developers can opt in to removing these (similar to removing data from the
FileSystemprovided by Expo. - It may be helpful to add more clear documentation about this behavior in the OTA updates section, otherwise people may push updates frequently without being aware of the potential impact to the app size.
Please let me know if I missed anything or if my understanding of Expo is incorrect!
Issue Analytics
- State:
- Created 5 years ago
- Reactions:10
- Comments:14 (9 by maintainers)

Top Related StackOverflow Question
Thanks for reporting this issue. We will look into it 😃
Closing as the fix has been released. We are working on a new Updates module which will have this functionality built in from the start.