Large Eclipse p2 folder with many .profile or .profile.gz files found
When you look in the p2 folder in your Eclipse installation directory or in your user home directory, you see many files with extensions .profile or .profile.gz.
The p2 folder is
The size might be larger than 100MB. The folder occupies more and more hard disk space after each installation change. That means:
- update of existing plugins.
Files with the
.profile.gzextension can be 30MB each. Eclipse creates them after each installation change.
p2 stores in the profile files the list of previous installation states. Each installation change adds a new entry. That means a new
Diagnosing the problem
Navigate to your product installation main folder or in case of multi-user installation to your user home directory. Then list all files inside the following folder.
If you see many files with the
.profile.gz extensions of more than 10 MB, this issue applies to you.
Resolving the problem
A manual solution and an automated solution in form of an Eclipse plug-in are available.
.profile.gz files except the latest one. These files have a name with the system time. Therefore a bigger number corresponds to the newer profile.
You can also use the Eclipse plug-in below. This limits the number of stored profile files to the n latest ones where n is a parameter that you need to define.
- profile files are necessary to perform a 'Revert' operation, because they store the configuration. You will not be able to revert to any previous configuration, for which you deleted the profile file.
- Starting from Service Pack 188.8.131.52 all new files have the .profile.gz extension and are actually compressed .profile files. The compression ratio is about 90%.
A. Plug-in installation instructions:
- for Eclipse 3.4.x use
- for Eclipse 3.6.x use
1. Stop your Eclipse application.
2. Copy the attached jar to the folder installation folder\dropins.
Make sure to select the appropriate jar version for your Eclipse application.
"3" is just an example. You need to specify how many profiles you want to keep.
4. Start your Eclipse application.
The plug-in will delete unnecessary profiles, when you close Eclipse or your Eclipse application. Examples are: Rational Application Developer for WebSphere Software, Rational Software Architect.
If you want to know exactly which files the plug-in will delete, consider the following steps before you start your Eclipse application.
- Create a
.optionsfile inside the folder where you have your
eclipse.exeexecutable and put the following line in it.
- Run your Eclipse application using the following command:
eclipsec.exe -debug -consolelog
- This will produce additional output from the plug-in that will inform you what happened and which files will be deleted when you close your Eclipse application.
The code that defines deletion of profile files is packaged inside the appropriate jar file. The reason why there are two separate plug-ins for Eclipse 3.4.x and 3.6.x is that the p2 mechanism that defines where and how to store profile files was refactored after Eclipse 3.4.2 and the plug-in appropriate for 3.4.2 will not work with 3.6.2.
All source code and/or binaries attached to this document are referred to here as "the Program". IBM is not providing program services of any kind for the Program. IBM is providing the Program on an "AS IS" basis without warranty of any kind. IBM WILL NOT BE LIABLE FOR ANY ACTUAL, DIRECT, SPECIAL, INCIDENTAL, OR INDIRECT DAMAGES OR FOR ANY ECONOMIC CONSEQUENTIAL DAMAGES (INCLUDING LOST PROFITS OR SAVINGS), EVEN IF IBM, OR ITS RESELLER, HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.