Eclipse PyDev completion hangs (yet again) - eclipse

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.

Related

Eclipse with old Sun USB Keyboard

I'm forced to work with Eclipse (3.6) now, and i would like to re-use my favorite Sun keyboard with the left function block for cut/copy/paste/undo/find/etc (can't code without it ..).
So far i got it working with about every IDE/Editor i used, but NOT with eclipse. The keybinding manager simply ignores these keys.
Any hints? Has anybody got it working? I thought it might be related to Java, but i have other Java tools that work (freemind, for example).
Thanks,
Felix.
Ok, i found a workaround by installing "autokey" and defining some rules that send -C/V/X/Y/Z to the eclipse window.
But i'm still curious why Eclipse ignores these keycodes/keysyms, especially since autokey needs to be started now (and sometimes crashes).

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 doesn't provide details on file search

I'm having a baffling problem with Eclipse on one of my machines, and it's driving me nuts. When I use File Search, I no longer get the details of each hit within the files. It used to do that, and at some point it stopped. I can only assume that I either installed some plugin that goofed it up or fat-fingered some obscure keyboard shortcut that caused it to stop working. My home machine, which has roughly the same setup (since I work on most of the same projects on it) does not have that issue. Here's a quick screen shot of my home machine, which does have the details that I would like:
And here's what it looks like on my other machine, with the lack of line context:
I'm totally baffled here. Can anybody help out?
Judging by past items...
...closing Eclipse and then running it with the -clean parameter (e.g. eclipse.exe -clean) might do the trick. Or it might not.
One more suggestion. This is not a nice or pretty suggestion and it doesn't tell you why you have a problem, but it just may work.
in your good machine, File -> Export... -> Preferences
in your bad machine, create a new empty workspace
import all of the preferences from your good machine.
If search is now working properly, then import all of your old projects to the new workspace.
This just might work.
This is identical to this comment thread on bugs.eclipse.org -> https://bugs.eclipse.org/bugs/show_bug.cgi?id=47136#c44
Unfortunately, the recommended solution is to reinstall Eclipse
You might try looking in the logs, to identify if there's a specific incompatibility with a Plugin.
From http://www.eclipse.org/eclipse/platform-core/documents/3.1/debug.html
Generally in Eclipse when you get an error, a message and stack trace
is logged to your workspace log. This is great but can easily be
missed unless you are looking for it. And some plug-ins silently log
entries to the log file. Tsk tsk. In order to never miss entries being
logged, we use the -consoleLog command-line argument. This basically
means "anything you log to the log file should be logged to the
console as well".
eclipse -consoleLog
So, try running eclipse -consoleLog, and see if you get an error when running the search. Do the same thing on both computers, to compare and contrast.
There are different kinds of searches in Eclipse. It looks like the first search is a "File" search. I am not sure what kind of search the second one is, but it looks quite different. Make sure you are doing a "File" search on the second machine.
CTRL-h (or CMD-h on Mac). Select the "File search" tab. If you don't see it, then click on "Customize..." on the lower left and ensure that "File search" is shown.

Eclipse: High CPU Usage during Autocomplete

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.

Freezing Eclipse

I use Eclipse for programming in PHP and Java(Android) and sometimes Python, unfortunately Eclipse is nowadays much more often freezing.
Often when I write this bracket "[" for defining an array in PHP, Eclipse just freeze and I have to close it manualy and start again.
I've noted also, that Eclipse is consuming really much of my RAM... 200-300MiB of my available memory is nothing special. :-(
Is there any way to check, what is consuming the memory in Eclipse and why it's freezing?
I'm running on Windows Vista, 3GB RAM.
Start eclipse with -consolelog option.
Start by looking at the error log. Under Windows → Show View → Other → Error Log. See if you can find any errors.
Another option is to try starting with a new Workspace (File → Switch Workspace). You can easily import your existing projects and see if the problem persists.
I would also recommend upgrading to PDT 2.2, which is part of the upcoming Helios release (Eclipse 3.6).
First thing, make sure that you have the latest version of Eclipse. Second, you can turn off things like automatic building, reporting problems as you type, content assist, and you can turn off the "Link with Editor" on the outline view to boost performance. The drawbacks, of course, are that you won't have those features.
As your code grows, with these features turned on, your performance decreases.
The memory range that you report can be normal, depending on the size of your code. However, the memory shouldn't continue to grow if you're not adding to the code.
I haven't witnessed any memory leaks in the latest version of Eclipse.
I was experiencing long delays with Eclipse on a large PHP project before I upgraded to a dual core processor.