Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 442049 - Eclipse 4.4 (JSDT) Attempting to copy from .js files in project, using ctrl+c or right-click menu, hangs/crashes JSDT in a big project #159

Closed
neatcode opened this issue Aug 7, 2014 · 34 comments
Milestone

Comments

@neatcode
Copy link

neatcode commented Aug 7, 2014

When I attempt to copy some of my source code using ctrl+c or the right-click menu "copy" command in any of the .js files in one of my Node.js projects, Nodeclipse hangs every time. It spins the CPU up to 100% and takes up all available memory.

I have a zip file you can unzip and import the project to replicate the issue here: http://www78.zippyshare.com/v/80482621/file.html (Use the orange "Download Now" button, the others are ads)

Just unzip the file to a directory and import it into your workspace, then try to copy source code out of any of the .js files in the project. For instance, server.js in the root directory exhibits the problem on my PC.

Note that this issue does not exist in some of my other Node.js projects. The project I'm working on here is the standard "mean.io" boilerplate, so many people are likely to encounter the same problem if they try out Nodeclipse as mean.io is quite popular. I HAVE tried regenerating the project file for the project using "nodeclipse -prepare" (after deleting the old project files) and that generated a new project which I reimported, however the issue still exists.

Do you know what's going on here?


Nodeclipse version (From the about box):

Enide Studio 2014 based on preview of Eclipse 4.4 M4 Luna

Version: 0.11
Build id: org.apache.maven.model.Build@7e6abaff

"Eclipse Standard/SDK"


C:\Enide\workspace\testmeanapp1>java -version
java version "1.8.0_11"
Java(TM) SE Runtime Environment (build 1.8.0_11-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.11-b03, mixed mode)


OS:
C:\Enide\workspace\testmeanapp1>systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
OS Name: Microsoft Windows 8
OS Version: 6.2.9200 N/A Build 9200

(64bit Windows)

@paulvi
Copy link
Member

paulvi commented Aug 12, 2014

Thank you for reporting.

I remember a year ago I ran into similar or saw similar on Stackoverflow.

This is JSDT issue. When you edit .js file Eclipse standard javaScript Editor from WetTools is used.
To check used version check Help -> Installation Details
It should be similar to this (1.6.0):

jsdt1 6

As you are using older Eclipse stack, trying to update to the latest 4.4.0 (released in June) on installing on fresh Eclipse Luna is first step to check.

Then if it is still their raise an issue on https://bugs.eclipse.org/bugs/ against JSDT
(and share link here)

I can't download zip, could you please email me at ***************

@paulvi
Copy link
Member

paulvi commented Aug 12, 2014

Also check in Project properties if JS sematic validation is turned off (JSHint should be used instead)

.project

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
    <name>NodeProject1</name>
    <comment></comment>
    <projects>
    </projects>
    <buildSpec>
        <buildCommand>
            <name>com.eclipsesource.jshint.ui.builder</name>
            <arguments>
            </arguments>
        </buildCommand>
    </buildSpec>
    <natures>
        <nature>org.nodeclipse.ui.NodeNature</nature>
        <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
    </natures>
</projectDescription>

.settings\org.eclipse.wst.jsdt.core.prefs

eclipse.preferences.version=1
semanticValidation=disabled

@paulvi
Copy link
Member

paulvi commented Aug 12, 2014

Update: I managed to download zip. It is 170MB compressed into 62MB
( What a huge size for a Node project! loooking further ...)

Most of them are under node_modules (150MB) in 60 folders, including things like forever that should be installed globally. Seems to be too much stuff.

Better to check if it is about mean.io but creating new project with mean.io only.

@neatcode
Copy link
Author

I did install Eclipse and Nodeclipse freshly after I encountered the bug. I also used a clean installation of Mean.IO, the bug still occurred.

Also, it shouldn't matter if I have alot of node_modules, Eclipse should be able to handle large projects. JetBrains WebStorm handles the same project just fine.

After you downloaded the zip and loaded the project, were you able to replicate the bug (did Eclipse hang when you tried copying from the source of a JavaScript file in the project)?

@paulvi
Copy link
Member

paulvi commented Aug 19, 2014

I just don't know what max size of source JSDT is capable of handling...

I got Eclipse 4.4 Luna freezing when just expanding testmeanapp1 under JavaScript Resource

then after 10-20 seconds I got "GC overhead limit exceeded"

jsdt-after-freezing

Eclipse is using 75% or 3 of 4 core of CPU

jsdt-after-freezing-cpu

@paulvi
Copy link
Member

paulvi commented Aug 19, 2014

after Eclipse restart, it freezes again during initial build...

after closing the problematic project Eclipse is still using 75% or 3 of 4 core of CPU

@paulvi
Copy link
Member

paulvi commented Aug 19, 2014

I submitted bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=442049 "Bug 442049 - Eclipse 4.4 (JSDT 1.6.0) freezes when expending project node under JavaScript Resource and/or making copy/paste operations"

please vote for it and follow

@paulvi
Copy link
Member

paulvi commented Aug 20, 2014

Work-around is to remove org.eclipse.wst.jsdt.core.jsNature nature in .project

<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
    <name>testmeanapp1</name>
    <comment></comment>
    <projects>
    </projects>
    <buildSpec>
        <buildCommand>
            <name>com.eclipsesource.jshint.ui.builder</name>
            <arguments>
            </arguments>
        </buildCommand>
    </buildSpec>
    <natures>
        <nature>org.nodeclipse.ui.NodeNature</nature>
        <!--  
        <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
        -->
    </natures>
</projectDescription>

Hint: on Windows you can use https://github.com/culmat/eExplorer to edit files inside closed Eclipse project

There is also Terminals that comes with Enide Studio

@paulvi paulvi changed the title Attempting to copy from .js files in project, using ctrl+c or right-click menu, hangs/crashes Nodeclipse Attempting to copy from .js files in project, using ctrl+c or right-click menu, hangs/crashes JSDT Aug 25, 2014
@paulvi paulvi removed the wontfix label Aug 25, 2014
@paulvi paulvi changed the title Attempting to copy from .js files in project, using ctrl+c or right-click menu, hangs/crashes JSDT Attempting to copy from .js files in project, using ctrl+c or right-click menu, hangs/crashes JSDT in a big project (posibly mean.io specific) Aug 25, 2014
@paulvi paulvi changed the title Attempting to copy from .js files in project, using ctrl+c or right-click menu, hangs/crashes JSDT in a big project (posibly mean.io specific) Attempting to copy from .js files in project, using ctrl+c or right-click menu, hangs/crashes JSDT in a big project (possibly mean.io specific) Aug 25, 2014
@vrubezhny
Copy link

Looks like link to the zipped test project isn't working anymore. Could anybody share that project again and put a link to it here or in https://bugs.eclipse.org/bugs/show_bug.cgi?id=442049?

Thanks in advance.

@paulvi
Copy link
Member

paulvi commented Nov 25, 2014

@neatcode Viktor (lead of Eclipse JSDT) needs sources to check

@neatcode
Copy link
Author

I don't have the original file from August, but reviewing my comment on August 17th -- you should be able to replicate the problem with a clean installation of mean.IO. Probably be sure to run npm install on mean.io too.

@neatcode
Copy link
Author

It was on a windows box... from http://mean.io to install mean:

npm install -g mean-cli 
mean init yourNewApp

then import the created yourNewApp into nodeclipse and try to copy some code out of it with ctrl+c

@neatcode
Copy link
Author

you might need to go into yourNewApp and run npm install first to ensure bug comes up

@neatcode
Copy link
Author

OK i just did all the steps and replicated the issue. Do the following from a Windows PC:
Install latest Enide Studio.
Install mean.io:

npm install -g mean-cli 
mean init yourNewApp

Then go into the yourNewApp directory and run npm install:

cd yourNewApp
npm install

then create a .project file for Enide Studio from that directory:

nodeclipse -p

then import the project into Enide Studio by following the directions produced by the nodeclipse -p command.
Then navigate to any .js file in the project and try copying a few lines of code with [ctrl+c].

Your Enide Studio instance should hang with high CPU usage, every time you try this.

@vrubezhny
Copy link

@neatcode thanks for the instructions. And one more question: could you share your memory settings here?

@neatcode
Copy link
Author

The memory settings are whatever is default for Enide Studio.

@neatcode
Copy link
Author

In the past I tried increasing all of them, however, and the problem persisted.

@neatcode
Copy link
Author

After drinking a bit I felt like admitting maybe I was being an ass with my previous answers. Here is my eclipse.ini (which I was ever so lazy to lookup before):

-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20140603-1326
-product
org.eclipse.epp.package.java.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=1.6
-Xms40m
-Xmx512m

@paulvi
Copy link
Member

paulvi commented Nov 27, 2014

Thank to @neatcode

@vrubezhny, I hope that it is enough to replicate

Note that nodeclipse cli is installed with

 npm i -g nodeclipse

(as mentioned on http://www.nodeclipse.org/updates/)

@vrubezhny
Copy link

Yes, it looks like I've got enough to replicate. Thanks!

paulvi pushed a commit to paulvi/mean that referenced this issue Nov 27, 2014
Eclipse-based Nodeclipse "Enide Studio" has support for MEAN

though we have open issue Nodeclipse/nodeclipse#159
@paulvi
Copy link
Member

paulvi commented Nov 27, 2014

I followed the steps and got the same issue

75% (3 of 4 CPU cores)

mean-io-75p-of-cpu-

that finishes with GC overhead

mean-io-75p-of-cpu-gc-overhead

Sources (without node_modules that are in .gitignore) are at
https://github.com/paulvi/meannewapp

(actually it uses full mean git repo https://github.com/linnovate/mean)

@paulvi
Copy link
Member

paulvi commented Nov 27, 2014

Again, I overcomed by removing <nature>org.eclipse.wst.jsdt.core.jsNature</nature>

@vrubezhny Currently configuration only handles node_modules, but not bower_components folders

\.settings\.jsdtscope

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
    <classpathentry excluding="node_modules/**/*" kind="src" path=""/>
    <classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
    <classpathentry kind="lib" path="node_modules"/>
    <classpathentry kind="output" path=""/>
</classpath>

JSDT Validation is disabled (JSHint-Eclipse is used instead)

@paulvi paulvi changed the title Attempting to copy from .js files in project, using ctrl+c or right-click menu, hangs/crashes JSDT in a big project (possibly mean.io specific) Bug 442049 - Eclipse 4.4 (JSDT) Attempting to copy from .js files in project, using ctrl+c or right-click menu, hangs/crashes JSDT in a big project (possibly mean.io specific) Nov 28, 2014
@andreialecu
Copy link

I have the same issue. Eclipse hangs when copy pasting from a client-side .js file in a node project while using Enide Studio. The file is about 700 lines long and has no external dependencies, it consists of an angular module.

I tried removing jsNature in my project and it didn't help. I also tried adding the above to .jsdtscope and it didn't help. Any other ideas?

I am not using mean.io.

Edit: I was able to resolve this by removing a project from my workspace. It was a rather big one, the library https://github.com/deployd/deployd .

@paulvi paulvi changed the title Bug 442049 - Eclipse 4.4 (JSDT) Attempting to copy from .js files in project, using ctrl+c or right-click menu, hangs/crashes JSDT in a big project (possibly mean.io specific) Bug 442049 - Eclipse 4.4 (JSDT) Attempting to copy from .js files in project, using ctrl+c or right-click menu, hangs/crashes JSDT in a big project Dec 25, 2014
@paulvi
Copy link
Member

paulvi commented Dec 25, 2014

@andreialecu Thanks for sharing. Did you managed finally to get project working?
Did removing jsNature was enough ? (.jsdtscope matters only if the project has jsNature)

If Yes, then this is JSDT issue, and should be reported to
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=JSDT

@andreialecu
Copy link

Removing jsNature didn't help in my case. I also uninstalled the js hint
plugin to no effect.

Only thing that helped was to remove the other big project from my
workspace. I didn't need it, so it was an acceptable workaround.

There are other reports of this problem here:
http://stackoverflow.com/questions/20392791/eclipse-hangs-on-copy-cut-for-javascript-files
http://stackoverflow.com/questions/25040701/eclipse-hangs-on-javascript-files-when-i-try-copy-cut-and-ctrlspace
http://stackoverflow.com/questions/1294135/eclipse-hang-when-copying-pasting-code
https://bugs.eclipse.org/bugs/show_bug.cgi?id=317249
https://bugs.eclipse.org/bugs/show_bug.cgi?id=323283

I tried most of those solutions but none of them worked.

@andreialecu
Copy link

By the way I only removed jsNature from the project I was editing at the
time, not from the other, big one (deployd). I had 3 node projects in my
workspace at the time.

I had this workspace configuration for several days with no issues.

This started happening suddenly after a big refactor in one of the projects
where I broke up a 2000 line file into about 6 files.

I also tried cleaning the workspace cache with no effect.

@andreialecu
Copy link

Alright, as a test, I just readded the deployd project to the workspace and the problem started happening again immediately.

I then removed the jsNature line from the deployd project and that fixed it! I can copy and paste inside my other project, and I can keep deployd in my workspace.

Hope this helps

@vrubezhny
Copy link

@andreialecu, could you attach /.metadata/.log file (or/and .log backup files if it's empty) somehow?

@andreialecu
Copy link

@vrubezhny
Copy link

@andreialecu, thanks for your logs!

The main problem I see is the lack of memory (and the many of OOM Exceptions in JSDT Parser). Increasing the available memory settings could help, but the chance is very small here... The parser/Compiler is most problematic field at the moment...

You can try to update JSDT to the latest WTP 3.6.2/3.7 (JSDT Core plug-in should be of v.1.3.200) if you didn't update this yet - there was a change in Compiler... But, i'm not sure it's a related issue.

And yes, the size of the project (and sideway projects that are live within the same workspace) matters.

Thanks.

@porfiriopartida
Copy link

I don't know if this helps, found this thread looking for JS Copy freezing my Eclipse 4.3 for Mac.

I unchecked everything in the JS Validator + removed the JS Nature without any help, increased the heap to 4gb but still the same issue.

In my case, hiding from Eclipse all build/dist/bower/vendor folder/files worked.. (resource filters)

Cheers.

@paulvi
Copy link
Member

paulvi commented Dec 30, 2014

Current summary:

And generally:

  • pay attention what step you have taken when working with any software.
  • experiment with little changes

Please add more solution not here but at
http://stackoverflow.com/questions/3515422/why-does-eclipse-hang-on-copy-paste-in-javascript-files
( the first issue raised Aug 18 '10)

@paulvi
Copy link
Member

paulvi commented Sep 22, 2015

@elvisvoer and all

I am going to disable JSDT by default because of this and ES6 support #194

paulvi pushed a commit that referenced this issue Sep 22, 2015
@paulvi paulvi added this to the 1.0 milestone Sep 25, 2015
loyaldev03 added a commit to loyaldev03/mean_stack_dev that referenced this issue Jan 8, 2018
Eclipse-based Nodeclipse "Enide Studio" has support for MEAN

though we have open issue Nodeclipse/nodeclipse#159
@paulvi
Copy link
Member

paulvi commented Jan 11, 2018

I guess this have been fixed in Eclipse long time ago.

Closing as old.

@paulvi paulvi closed this as completed Jan 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants