1

I am using:

  • O.S.: Windows 7
  • IDE: Eclipse Luna (4.4)
  • RAM: 16 GB
  • Processor: core i7

Problem:

When I press Ctrl+C / Ctrl+X / Ctrl+space (or Copy/Cut from the right click menu) in JavaScript files (~100 lines / file), Eclipse hangs. It is back in about 1 minute.

This thing doesn't happen if I use Ctrl+C after another Ctrl+C. It also doesn't happen if I use Ctrl+V or Ctrl+S.

I tried to:

  • disable Mark occurences from Javascript > Editor > Mark Occurences
  • uncheck all the plugins
  • disable validator for Error/Warnings
  • disable Hyperlinking from General > Editors > Text Editors
  • restart Eclipse

but the problem was not solved.

During the problem, the CPU works very hard and the memory is more used (because of eclipse.exe).

The project is open in Eclipse as a JavaScript project and it has about 30 MB (because of some libraries), but the attempt to copy/cut is only for small strings.

The problem seems to be similar to this one: Eclipse hangs on copy/cut for JavaScript files but those solutions didn't work for me.


The problem seems to be related only to Node.js files. In other JavaScript files it works fine.

Community
  • 1
  • 1
ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199

3 Answers3

1

This problem seems to be with the Hyperlinking for JavaScript Editors. To solve this go to

Window->Preferences->General->Editors->Text Editors->Hyperlinking

and uncheck the option

Link Kind = "JavasScript Element" 
Available In = "JavaScript Editor"

I also tried to change the Modifier Key but that did not fix the issue. Another option would be to disable all Hyperlinking. Hope this helps!

enter image description here

Andy Braham
  • 9,594
  • 4
  • 48
  • 56
1

I had been stuck on this error as well using Eclipse Luna. I had tried lots of solutions, but ultimately, the issue was my javascript project was setup with a javascript nature. Granted, that shouldn't have been a problem, but using the java heap monitor I was able to see it immediately permanently solve the problems I was having with eclipse hanging and freezing up with javascript files.

Project Natures are used in the Eclipse IDE in order to configure projects in the workspace. One project may consist of several project natures. The most popular project nature is org.eclipse.jdt.core.javanature , which is used to specify the project as Java project.

My .project file had these entries for the natures and when I removed the jsdt line, which made it a javascript project, the problem went away:

<natures>
        <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
        <nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
        <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures>

Since my project was an Angularjs project, I was able to load the Angularjs Eclipse plugin and convert it to an Angular project without issues.

I realize this solution has the detriment of not having the javascript nature in the project, but for me, it was better than dealing with the constant memory issues.

James Drinkard
  • 15,342
  • 16
  • 114
  • 137
0

If you have problems like this one, then start jconsole and connect to the process. If Eclipse refuses the connection, add -Dcom.sun.management.jmxremote=true after the line -vmargs in eclipse.ini.

When Eclipse "hangs", look which threads are active and create a snapshot of the stack trace. That'll give you an idea which methods are busy.

Related:

Community
  • 1
  • 1
Aaron Digulla
  • 321,842
  • 108
  • 597
  • 820
  • I monitored it using jconsole and during the hang there were only 2 new threads: - before: 36 (main, Reference Handler, ..., Worker-110) - after: 38 = 36 + Worker-112 + Worker-113 – ROMANIA_engineer Jul 31 '14 at 07:29
  • In the main thread there is an interesting line between 2 lines containing ClipboardOperationAction$1.run and ClipboardOperationAction.run. It is org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70). – ROMANIA_engineer Jul 31 '14 at 07:43
  • If you see `showWhile()`, then a long running thread blocks the UI. So the problem is either further up in the stack or in another thread. – Aaron Digulla Jul 31 '14 at 10:36