Eclipse 100%+ CPU usage with specific workspace - eclipse

I'm using Eclipse Luna. As soon as I open this workspace java CPU usage goes to over 100% and doesn't go down. Doesn't happen with other workspaces. I tried several things, and they don't work:
Running ./eclipse -clean
Deleting the org.eclipse.core.resources folder in the .metadata/.plugins directory of the workspace and then reimporting all the projects into the workspace: this seemed to work yesterday, but today the workspace is freezing again.
I forgot to mention, it's not just CPU usage, the main problem is that the workspace is freezing and I can't do any action (can't edit code, can't open files, etc...). I think there's something corrupted with this workspace, because other workspaces work fine without increasing RAM availability. Tried the -Xmx thing, but it doesn't work anyway.

%CPU usage is fine showing more than 100% by using top command, doesn't mean that you are in trouble until its too high.
Actually Your eclipse need more memory to run.
you should run eclipse by passing Xmx args with more memory
./eclipse [normal arguments] -vmargs -Xmx1256M [more VM args]

Related

Eclipse Freezes Constantly

I've heard rumors about "Eclipse's minute of silence", but I had no idea how bad it is.
I've installed a brand new Eclipse (from a ZIP package) and only installed the JBoss tools. Now Eclipse freezes at close to each key shortcut, but at least once every 30 seconds. Ctrl+C? One minute Freeze. Doesn't copy. Ctrl+D? One minute freeze. Also, doesn't delete any lines. Clicking into an editor? One minute freeze. It also takes everything with it, so e.g. my browser won't work while Eclipse freezes.
It is not possible to work like this. At all. My colleagues just went back to Eclipse 2018-09, but I need Java11, so I can't.
I could not find any bugs for this issue (a lot of bugs for Eclipse freezing, but none that should still be present in 2018-12).
Anyone else experienced something like that? It's our entire office, so it's not just one faulty computer. Could it have something to do with how Eclipse scatters its config files over the hard drive? Maybe it can't read the 2018-09 config files or something?
If you use the Project Explorer, this could be caused by bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=536918 which is already fixed for Eclipse 4.11 (and will be released as Eclipse 2019-03 in March)
You can use an integration build from http://download.eclipse.org/eclipse/downloads/
As workaround, it might also help to to close the Project Explorer View (in all perspectives) and use the Package Explorer instead.
As others have written, it might also be a memory issue. Open the Eclipse Preferences and
in the General section enable Show heap status so you can see it at the bottom of the window.
If this is the problem, edit eclipse.ini and increase the memory settings (open eclipse.ini and increase the number of the line with -Xmx. If you have a mac, right-click on the Eclipse Application, choose Package Contents, find it at Contents/Eclipse/eclipse.ini)
I was facing this "lagging"/"freezing" issue in Eclipse 2018-12 until I did this.
in eclipse.ini
-Xms256m
-Xmx4096m
Of course it has not stopped "freezing" completely, but The number of times has been tremendously dropped.

Eclipse - “Workspace in use or cannot be created, chose a different one.” even after I removed .lock

I moved my workspace, moved it back, and now I get this error. The other thread on this error suggests I delete the .lock file from the .metadata folder, but it doesn't work.
Sometimes the eclipse or java process is still running, even if you don't see any UI of Eclipse anymore. It might then still hold file locks or other OS specific resource locks.
Therefore please always kill all eclipse processes (and the related java processes) before trying to use a workspace again after a crash. If you are unsure about the processes, rebooting is the safe way to do this.
You can try to launch Eclipse as Administrator. Probably you have a permissions problem
in your commandline, run eclipse as:
eclipse -clean

problem in linking viewer selection with current editor - Eclipse

I often get this error "Operation linking viewer selection with current editor finished with errors" in Eclipse Galileo.
Once this error pops up no UI events is working in the IDE , i cant even able to close it also. Every time i have to go to task manager to stop the process , after this IDE works fine for some 5 min and again it display the same error as mentioned above.
i don't know what is happening , can you guys please help.
Just switch your Project Explorer to the Flat package presentation in Eclipse. It works :)
see details here: https://bugs.eclipse.org/bugs/show_bug.cgi?id=530450#c7
Per the Eclipse manual:
PermGen is the permanent generation of objects in the VM (Class names, internalized strings, objects that will never get garbage-collected). An easy, if somewhat memory-hungry fix is to enlarge the maximum space for these objects by adding
-XX:MaxPermSize=128M
as an argument to the JVM when starting Eclipse. The recommended way to do this is via your eclipse.ini file.
If you are getting OutOfMemoryErrors while running Eclipse, the VM can be told to let the heap grow to a larger amount by passing the -vmargs command to the Eclipse launcher.
-vmargs
-Xms512m
-Xmx1024m
Alternatively, you can invoke the Eclipse executable with command-line arguments directly, as in
eclipse [normal arguments] -vmargs -XX:PermSize=512M -XX:MaxPermSize=1024M -Xmx1024M [more VM args]
Even with recent versions of Eclipse and Flat Package presentation, if you have a lot of large projects loaded this can still be a problem.
I've found however that if you break up your projects into working sets and minimise the amount of projects/tree nodes open by selecting a working set it can really speed up Eclipse and mitigate this problem.
I had this problem (Version: Photon Release (4.8.0)) and I fixed it by removing all breakpoints.

Eclipse Performance Maintenance

Is there a cache or something that needs be cleared periodically?
Eclipse has been running pretty badly lately, especially with regards to open files and switching between them in the editor.
Frustrated and confused.
There is nothing that you as a user need to run periodically to keep Eclipse performing. I would guess that you are seeing performance problems due to Eclipse process hitting its allowed memory ceiling. Take a look at your eclipse.ini file and update the -Xmx setting. Don't crank it up too high as that can keep your Eclipse from starting.
You can delete old configurations. This might speed up start-up time, but I'm not sure. Ignore the revert highlight on the image. What you need is the delete button that appears in later versions of Eclipse next to it. Delete everything but the current installation configuration.
To access, go to Help > About Eclipse SDK > [Installation Details] > Installation History.
Also, make sure you have projects other than the one you're working on closed. Doing this reduces the size of the in-memory Eclipse workspace model.
Also make sure projects that you are running are shutting down correctly (or manually terminate them). I have found times that a project I was testing did not end after an error and I had 10 instances of it running in Eclipse, I had to select the console and manually end it. (Closing and opening Eclipse also frees things like this up).
You can give more memory to it , modifying eclipse.ini file. For example:
-vmargs
-Xms384m
-Xmx768m
default ones 256-512m.
Look here for optimal JVM settings when running eclipse
Sometimes if you've had the workspace for a very long time eclipse would run slower, delete the old workspace and then create a new one, importing the project into it again (Make sure to check in or backup your code first).
I wouldn't really recommend tampering with the eclipse JRE runtime parameters. But if you are at liberty to update eclipse, I would recommend you update it to the latest version.
I've added some tips that could help improve the performance of eclipse in an answer to a question.

How to make the eclipse IDE to build faster

I am using Eclipse for development. However, it's is taking too much time to build.
It hangs when the percentage of build gets to 78. It shows "refreshing workspace" several times. That eats up lots of time.
How can I make Eclipse faster?
Increase the start-up memory as mentioned by thamaria
Disable spell check of eclipse
Disable the plugins which you never use it (myln etc)
Disable auto build.
This link might help you
http://pakkatechies.blogspot.com/2011/07/making-eclipse-ide-faster.html
There are many possibilities to tune Eclipse.
First, when Eclipse is hanging up you should start Eclipse with some arguments and give it more memory. Use: eclipse -vmargs -Xms256m -Xmx1024m or even more.
EDIT: "eclipse -vmargs -Xms256m -Xmx1024m" is the commandline command with which you can start Eclipse (well, depending on your OS). For that you either need to have eclipse in your environement path or you will have to use an absolute path to your eclipse executable file. Under Windows systems you may use for example "C:\Programme\eclipse\eclipse.exe -vmargs -Xms256m -Xmx1024m". You could f.e. create a short-cut with this command.
Second: If possible you can use several workspaces for your eclipse projects if they are not connected to each other. When using other projects than the ones located in your actual workspace switch the workspace to the one you desire. That way eclipse does not need to load all contents at startup and will therefor start much faster.
Third: You can disable the "build workspace" Option. Go to "project" --> and uncheck "build automatically".
In the project build properties, under behavior tag, check the 'Enable parallel build' box.