Multiple numbered copies of com.google.android.gms inside /data/app using up all the space on a device
I have an old Nexus 5X running Paranoid Android 6.0.1. I've started noticing that disk space is constantly running low despite not really adding any new files, and poking around with root I found that the main culprit are 30 duplicate copies of
com.google.android.gms, sequentially numbered
/data/app/, each taking up 300 to 400 Mb, ultimately adding up to little over half the entire disk space available on the device. The first one has been created back in 2016 when the phone was new and the 30th just last week. Similarly I have 35 copies of
com.google.android.vending, but at the very least they take up considerable less space.
I'm aware that this is supposed to be the app for Google Play Services but I don't understand why there are so many of it. The folder sizes are different, the lower numbered being smaller and constantly rising, so they aren't the exact same files either.
Currently it's getting to the point that it's impossible to update apps because Play Store requires a lot of free space to initiate any update and any time I free up enough space the phone seems to start creating yet more copies of the app with no end in sight.
Basically my question boils down to:
- Why are there so many copies of these files, is this intentional or a bug?
- Can I somehow safely reclaim any of this space? What would happen if I deleted some of them?
Analeea last edited by
As per Robert's comment on the question, I checked under
/proc/PID/fdto see that indeed the GMS process is using only the highest numbered files under
/data/appin my case (Where
PIDis the GMS process ID which you can find, for example, by running
psin the terminal or any of the countless "process monitor" -style apps available on Play Store).
Aftwerwards, I proceeded to simply delete all of the
-29folders, freeing up all the used space. I have since rebooted the phone and tried starting most of my apps, and so far I'm seeing no adverse effects. GMS process is still running and happily using the latest files. Whether the next GMS update will go under
31or the first free index remains to be seen. While this wont fix the root cause and undoubtedly I'll get duplicates of the files in the future as well, at least it happens slowly enough that periodically deleting them manually is at most a minor inconvenience.
As for the obligatory disclaimer: This solution suggests poking around in system folders using root access and directly deleting files in them. Your mileage may vary: While my phone appears to work now I cannot absolutely rule out the possibility of having any issues down the road, nor can I guarantee that doing this on your phone has the exact same effects as it did on mine. You do this at your own risk. Do the prudent thing and take backups before messing around with system files, and if you do, do be extra careful to only delete what you intend to and nothing more.