Eclipse: High CPU Usage during Autocomplete - eclipse

I've been using Eclipse without issue (I mean, besides the usual) for several weeks now. It's been speedy enough for my purposes. But as of today around noon, anytime I start typing an HTML tag or other autocomplete-able element, my whole System bogs down so much it's completely unusable. Watching in Task Manager, I show that Eclipse jumps from 0 up to 10-15% every time I type a "<" or ">" symbol!
I have a Core i7 PC with 6 GB of RAM, so this definitely isn't a system specs limitation. I've also uninstalled a couple of programs I installed today hoping maybe one of them was conflicting, but no dice. Even after a restart, I am unable to use Eclipse without pausing for several seconds every time it tries to auto-complete!
Anyone know what's going on here? I did some searching but all I found were VERY old bug reports that say the developers "are aware of the issue and are working on a solution".

First, I'd try bumping up the memory that eclipse has allocated to it:
-vmargs
-Xms2048m
-Xmx3072m
-XX:MaxPermSize 128m
That should be in your eclipse.ini file. This blog has some great reading as far as memory and Eclipse are concerned. Also you can read this lengthy SO thread if you need some more info and / or wish to induce sleep.
Next, try speeding up autocomplete. Go to Window / Preferences / Java / Editor / Content Assist / Auto-Activation and decrease Auto activation delay from 500 to zero.
Finally, you might look into hippie complete; the default key binding in Eclipse is 'alt-/' . This is also called "Word Completion" if you check out the shortcut list 'ctr-shft-l' ( that's L as in list ). On my mac the default key setting is 'ctr-.' . This is a faster version of autocomplete that I believe harkens back to the days of emacs. It seems to work great with local variables but not so great with functions on objects. Different beast I guess.
As a bonus, you can check here for a list of ways to speed up the Eclipse experience in general.

First, just as a test, try switching to a new workspace (File → Switch Workspace → Specify a folder which does not exist, it will be created).
If the problem is solved, this could be an issue with some bad settings or cache in your current workspace. If you can easily move to this new workspace (don't know how much effort you've put in customizing your workspace), I'd do that.
If you want to fix your current workspace, go into the .metadata/.plugins folder of your workspace, and look for folder that start with org.eclipse.wst. I'd try to take them out, and see if it helps (close Eclipse first). You may lose mostly history and cache in the process. You can check the folders specifically and intelligently guess what should stay.
If the problem is not solve by changing workspace, I would try downloading a fresh copy of Eclipse. You could try to reset the configuration folder, but that's a bit risky. If it's too much trouble, I'd start fresh.

Related

Eclipse Neon Pathetically Slow

Is there a way to identify what's going on with Eclipse when a file is saved?
My eclipse runs extremely slow (takes close to 3 minutes to save a file). Simple addition of a space in a file and save, it keeps saying 'Updating Navigator Content Viewer' and 'Remote System Explorer Operation' and simply freezes.
I am running on a powerful system with 16 gigs of ram and assigned 1 gig for eclipse. The way it performs is simple unacceptable and planning to switch all my projects to NetBeans rather than wasting hours on save.
Any hints on fixing this are appreciated.
Finally resolved the issue by getting rid of Eclipse.
Moved all my projects to NetBeans 8.2. Its a big relief to see my projects getting saved in a split second.
Coming to Eclipse, it is powerful and exceptional on all aspects other than the slowness during save. However, this frustrating issue alone makes me rate Eclipse 1 (may be 0) on a scale of 10. Cannot expect a developer to wait for 2 minutes to save a file (on a 16 gig system, with 4 gigs assigned to Eclipse) which would drag the productivity drastically.
Looks like this issue is not something new as I have seen many posts on various forums regarding the same. I don't understand how Eclipse never gave a thought on this slowness issue.
First you should try to look at this post so:
Check if it is the latest version (I personally run Neon 4.6 and it takes about 2 minutes to parse and save a 55MB file)
Check your JDK/JRE
You should also try to see if it doesn't come from your drive...
If you still have the problem, I suggest you look at the other Eclipse versions (Mars...)

Rescuing eclipse from bad workspace/project data

I would like to take a step backwards opening eclipse without it automatically opening the source files which were last open, nor the projects which were last loaded, I have reason to believe this might clear it all up.
Motivation being that as of a forced quit of eclipse, after it had gone stuck after some project changes, my eclipse Luna is no longer able to start without getting hung up again.
How may I accomplish that?
It's important to me not to lose my settings such as syntax highlighting and stuff, while performing the salvation... and whereas I am pretty certain I could locate my workspace directory on disk, would be nice finding where does eclipse keep the pointer to it, just to make sure I'll be tinkering with the right workspace, if needed..
I guess I could call it "starting eclipse in safe mode" :)

How many projects/folders/files can eclipse (the editor) safely handle?

I am always the first one to jump on any latest Eclipse release thinking that it would solve some of the issue that i have with slowness but i am always disappointed. The DLTK thing that keeps running, memory heap issues, internal error occurred ....
The latest version that I have tried is KEPLER
I know that I can close the projects that i am not using, disable validation, remove projects from the build path, hack into their myriad of codes and change settings but really?
I have to admit my workspace has only 5 projects but more than TWO HUNDRED heavy duty folders. within those folders you have for example, Drupal, Wordpress and so on..
I have used visual studio for years with 5 times as much projects without this kind of slowness but that is besides the point. Let's go back to eclipse.
looking at my settings, some people might say: why don't you create a projects for each of those folders? I tried that but the DLTK indexer keeps on indexing every projects in my workspace unless i close them. WOW!!! Create multiple workspace is out of the questions, if i have to do that i will just ignore Eclipse all together.
My hardware is decent and I have SSD Drive and plenty of RAMs.
What is the largest amount of projects or files can Eclipse safely handle? What about the DLTK what are its limitations?
How large is too large?
What doesn't visual studio seem to suffer from the same slowness? Is the problem java related or with the data structure? Can Eclipse handle that amount of projects?
I know that there are a lot of moving parts and answering these questions is not black and white but why is this thing indexing even the stuffs that i am not using?
I would like to get some opinions on how to use this editor effectively?
While the number of projects/files is not exactly "limited" (beside the resources of the host machine), the number of open editors is.
Eclipse 2019-09 proposes by default 99.
Close editors automatically when reaching 99 open editors
The preference to close editors automatically is now enabled by default.
It will be triggered when you have opened 99 files.
If you continue to open editors, old editors will be closed to protect you from performance problems.
You can modify this setting in the Preferences dialog via the General > Editors > Close editors automatically preference.
IDEs are slow by nature because they do a lot.
I would never use eclipse for webdev stuff like wordpress.
You should be leaving your library files outside of your main project as external folders so that eclipse discounts them. That way you can just have the files you need in your workspace.
Also, try closing the projects you aren't working on by right clicking and choosing "close project"
Personally I use vim and FTP to handle this stuff. Eclipse is nice and integrated but very chunky.

Problems with PyDev & Eclipse Juno on osX10.8

I have had this problems for a couple of times but usually could solve it by an update. However, this fix does not work for me anymore.
Actually, two problems here:
The minor one: I have osX 10.8.3 and Eclipse Juno (M20130204-1200) installed. Since a good amount of time, it takes eclipse ~ 4-5 minutes to start up for the first time after the system start. Once it was closed and is re-opend again, it starts up quick. I think this problem came since apple started to mess around with the JRE? Does anybody also experienced this delay? Could it be that one of the installed plugins checks for updates and causes the delay?
The major one: after eclipse is fully up & running, I can not open .py files anymore. When I open my pydev project (btw. pydev 2.7.3), eclipse freezes and I need to kill the whole thing and restart. -> I can not use it for python coding anymore, which is my primary task...
Suggestions? Re-install eclipse maybe?
Thank you for suggestions,
El
Can't really comment on #1, but for #2, can you try attaching jvisualvm to see what's going on there? (and create a thread-dump and post it somewhere so that I can take a look at it).
I'd ask you to create a bug-report for that, but the new tracker is still not up (I hope I'm able to put it up right after the funding at http://igg.me/at/liclipse is finished).
The problem was resolved by following these steps. They essentially disable one
JRE.http://support.apple.com/kb/HT5559?viewlocale=en_US

Eclipse PyDev completion hangs (yet again)

I'm using PyDev in Eclipse as my Python editor. It's fine in terms of feature set. Everything works fine except for one very annoying thing:
Code completion itself works fast. When I press Alt+Space, the window pops out almost instantly and all the options are there. The option at the top is selected. Then comes the trouble. The detailed description won't appear until about 5-10 seconds. All this time CPU is working at maximum load and the interface is not responding. All the processor is consumed by the Eclipse Java process (the spawned Python process seems idle). Then a yellow window pops up, and all it contains is just a Python code of a selected function/variable. All consecutive details are displayed instantly. The procedure repeats when I close the completion window (for example by accepting one of the options and asking for completion again). This drives me crazy.
I've tried so far:
creating a whole new workspace,
creating an Eclipse/PyDev project from scratch,
tweaking JVM to make sure it has loads of memory,
making sure the right JVM is chosen (the latest Oracle JVM available),
making sure Python process communicates freely with the Java instance (I read about possible problems with that, but it seems not to be the issue).
making sure all the installed plugins are up to date.
The version I use is Eclipse Helios, because the last time I checked certain extensions weren't yet ported to the latest one.
Has anyone observed a similar issue? Was anyone able to get around it? General ideas on how to debug it and file a sensible bug report possibly? Other things worth checking for.
Any workaround less drastic than turning completion off completly?
Thanks!
EDIT:
I've also noticed a problem with a similar popup window in HTML/CSS editor. It looked somewhat similar (a yellow window, with some text inside) and it also took ages to display. Don't really know if that is related, but could be.
EDIT(2):
Ok, No I've started with a fresh install of the newest Eclipse Indigo, without any additional plugins apart from PyDev and the issue remains. Seems like I'll have to look for a new IDE.
What version of Java are you using?
If you are on Windows 7, later versions of Java (I think 6+) will default to IPv6.
This is probably causing the problem as Python maybe wanting IPv4.
Anyway, since I had this problem I tried disabling
PyLint
Code Analysis
but it was still hanging.
Pal's answer about "ipv4 utilization" triggered my memory about another problem I had solved by "preferring" IPv4.
See http://docs.oracle.com/javase/1.4.2/docs/guide/net/ipv6_guide/
What you want to do is to edit your eclipse.ini and add "-Djava.net.preferIPv4Stack=true" in the vmargs section
-startup
plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
...
-vmargs
-...
-Djava.net.preferIPv4Stack=true
...
I no longer get hangs.
Is there any chance you can provide the code that's making that happen (and add it to a bug report see: http://pydev.org/about.html for links)?
I use PyDev daily with some very large projects and don't have that problem, so, it may be some specific construct or scenario in your code -- or maybe you just haven't given Eclipse enough memory (which would make the garbage collector work much more), in which case, take a look at: What are the best JVM settings for Eclipse? (in specific, raise your -Xmx flag, although you can probably use the other tips there too).
If you can't provide a reproducible scenario, the other choice would be getting a profiler (i.e.: YourKit java profiler has a 15 days free which would help in this case), running that use-case in the profiler and passing a snapshot of what's happening in this situation (if that's the case, please open a bug report at pydev.org and I can help you there).
I got this from pydev.org FAQs and it works fine for me.
When I do a code-completion, PyDev hangs, what can I do?
PyDev does most of its things in the java side, but some information can only be gotten from the python side (mainly builtins), so, in order to get that info, PyDev creates a shell and communicates with it through sockets.
The main problems when that happens are:
There's a firewall blocking the communication to the shell
In Linux, some kernels do not allow ipv4 utilization, which may make PyDev fail.
To enable it, do: echo 0 > /proc/sys/net/ipv6/bindv6only
The timeout to connect is too smal.
It depends upon the "Timeout to connect to shell" in the code-completion preferences (window > preferences > PyDev > Code completion)
If nothing works, please report a bug (also, check if there is anything on the error log (window > show view > PDE Runtime > Error log) and on the eclipse '.log', which is located at the .metadata folder of the workspace location.