Search code examples
eclipsediskspace

Reducing disk-space consumption of Eclipse


I am trying to free some disk space. I found out that files related to Eclipse take up a lot of space. I would like to know which of them I can remove without harming the operation of Eclipse. In particular:

  • The folder ~/.p2 takes 1 GB. Most weight is in .p2/pools/plugins. Is it the real code of the plugins or only a cache that can be deleted?
  • The eclipse-installer takes about 60 MB. Do I need it after instasllation or can I delete it?
  • Are there any other cached files that can be deleted?

(I have Eclipse Oxygen on Ubuntu 16.04, if that matters).


Solution

  • You can safely delete the eclipse-installer. It's components are embedded into your installation and therefore there is no dependency on it anymore.

    As for ~/.p2, this is the main code of your Eclipse installation. The good thing about it is that multiple instances installed via the eclipse-installer share the P2 pool.

    The bad thing about it is that it does not clean up any unnecessary bundles after updates automatically, so there might be old and unused versions of bundles in that folder. You can use the Cleanup Agent of the Eclipse Installer to clean up the bundle pool (kudos to howlger for the cleanup hint!)

    If you are doing Eclipse development (PDE), the .metadata\.plugins\org.eclipse.pde.core folder might be one of the most effective places to free disk space, because launch configurations and target platforms store their configuration and caches there. But this only makes sense if you do not plan to use Eclipse for a while...