3

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 com.google.android.gms-1 to com.google.android.gms-30 under /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?
3
  • 2
    Possibly similar situation: Can I delete old trichrome library under /data/app?
    – Andrew T.
    Nov 25 at 4:44
  • Looks like the Google self-update code is a bit messy (or has some problems with rooted devices). To my knowledge only one version of GMS and Play Store can be active at one time so old versions should not be needed anymore. You can try to check /proc/PID/fd of the com.google.android.gms process which files are used (my assumption would be that only the -30 files are used and all the other versions can be removed).
    – Robert
    Nov 25 at 10:00
  • @Robert yup, it appears you're correct, the process is using only the latest -30 files. I took the plunge and simply deleted the earlier ones, and after rebooting and checking that my apps are still functioning even after that, it does seem like just deleting them is the best solution. I'm going to formulate that as an answer, thanks!
    – Kryomaani
    Nov 25 at 20:23
2

As per Robert's comment on the question, I checked under /proc/PID/fd to see that indeed the GMS process is using only the highest numbered files under /data/app in my case (Where PID is the GMS process ID which you can find, for example, by running ps in the terminal or any of the countless "process monitor" -style apps available on Play Store).

Aftwerwards, I proceeded to simply delete all of the com.google.android.gms-1 thru -29 folders, 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 31 or 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.