Skip to content

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

Description

@neatcode

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)

Activity

  1. paulvi commented on Aug 12, 2014

    @paulvi
    Member

    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 ***************

  2. paulvi commented on Aug 12, 2014

    @paulvi
    Member

    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
    
  3. paulvi commented on Aug 12, 2014

    @paulvi
    Member

    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.

  4. neatcode commented on Aug 17, 2014

    @neatcode
    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)?

  5. paulvi commented on Aug 19, 2014

    @paulvi
    Member

    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

  6. paulvi commented on Aug 19, 2014

    @paulvi
    Member

    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

  7. paulvi commented on Aug 19, 2014

    @paulvi
    Member

    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

  8. paulvi commented on Aug 20, 2014

    @paulvi
    Member

    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

  9. 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[/+] on Aug 25, 2014
  10. 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)[/+] on Aug 25, 2014
  11. 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)[/+] on Aug 25, 2014
  12. 18 remaining items

  13. paulvi commented on Dec 25, 2014

    @paulvi
    Member

    @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

  14. andreialecu commented on Dec 25, 2014

    @andreialecu

    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.

  15. andreialecu commented on Dec 25, 2014

    @andreialecu

    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.

  16. andreialecu commented on Dec 25, 2014

    @andreialecu

    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

  17. vrubezhny commented on Dec 25, 2014

    @vrubezhny

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

  18. andreialecu commented on Dec 25, 2014

    @andreialecu
  19. vrubezhny commented on Dec 25, 2014

    @vrubezhny

    @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.

  20. porfiriopartida commented on Dec 27, 2014

    @porfiriopartida

    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.

  21. paulvi commented on Dec 30, 2014

    @paulvi
    Member

    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)

  22. paulvi commented on Sep 22, 2015

    @paulvi
    Member

    @elvisvoer and all

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

  23. added a commit that references this issue on Sep 22, 2015
  24. added this to the 1.0 milestone on Sep 25, 2015
  25. paulvi commented on Jan 11, 2018

    @paulvi
    Member

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

    Closing as old.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions