Bug 324299 - [performance] Javascript editor crashes or destabilizes Eclipse
Summary: [performance] Javascript editor crashes or destabilizes Eclipse
Status: REOPENED
Alias: None
Product: JSDT
Classification: WebTools
Component: Web (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 major with 3 votes (vote)
Target Milestone: Future   Edit
Assignee: Project Inbox CLA
QA Contact: Chris Jaun CLA
URL:
Whiteboard:
Keywords: needinfo, performance
Depends on:
Blocks:
 
Reported: 2010-09-02 08:40 EDT by Marc CLA
Modified: 2015-04-12 12:18 EDT (History)
6 users (show)

See Also:


Attachments
javascript file (14.45 KB, application/x-javascript)
2010-09-03 11:18 EDT, Marc CLA
no flags Details
jsdtscope (508 bytes, text/plain)
2011-06-06 08:31 EDT, Marc CLA
no flags Details
all the .settings folder (4.82 KB, application/x-zip-compressed)
2011-06-06 08:34 EDT, Marc CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marc CLA 2010-09-02 08:40:20 EDT
This has been going as long as I remember at least from Eclipse 3.4 and it's still there in Helios.

Behaviour is sudden spikes in memory use and consequent crashes of subcomponents of Eclipse with the suggestion to close the editor. If you don't, UI responsiveness is crap.

My assumption is that it gets stuck in endless loops while trying to analyze the code or something like that.

If you close all js files and force garbage collection, memory use drops to accetable levels again
Comment 1 Marc CLA 2010-09-03 11:18:33 EDT
Created attachment 178163 [details]
javascript file
Comment 2 Chris Jaun CLA 2010-09-15 17:09:53 EDT
Are you doing any content assist or some other operation when you see the memory spikes?
Comment 3 Marc CLA 2010-09-15 17:39:34 EDT
Nope, just opening a javascript file is enough. It's been that way across several major version releases of Eclipse, various projects, various machines.
Comment 4 Chris Jaun CLA 2010-09-16 10:23:52 EDT
I am able to open that file without trouble.

I just created a new workspace, with a single project, containing a that one file.

I assume your workspace is more complicated than that? Do you have other javascript files in that project or in other projects in the workspace?
Comment 5 Chris Jaun CLA 2010-09-16 10:28:24 EDT
I'm marking this one as a duplicate because I was able to reproduce this problem with the even larger file included in BUG323283.

*** This bug has been marked as a duplicate of bug 323283 ***
Comment 6 Marc CLA 2010-09-16 10:47:04 EDT
Ok, so it's reproduced now. Good. If you need more details about my workspace let me know. Yes, multiple js files but it *seems* to happen just opening one. But I have Eclipse open all the time, sometimes days at an end, so that might just seem that way to me.
Comment 7 Nitin Dahyabhai CLA 2010-09-16 11:20:48 EDT
(In reply to comment #6)
> Ok, so it's reproduced now. Good. If you need more details about my workspace
> let me know. Yes, multiple js files but it *seems* to happen just opening one.
> But I have Eclipse open all the time, sometimes days at an end, so that might
> just seem that way to me.

Do you have other files in the Include Path containing functions that declare lots of local variables?
Comment 8 Marc CLA 2010-09-16 11:30:04 EDT
Well, not sure what you mean with the "include path" but I have YUI 3 and YUI 2 in the webapp folder if that's what you mean. They contain a large amount of js files with lots of local variables.
Comment 9 Nitin Dahyabhai CLA 2011-06-06 02:43:49 EDT
(In reply to comment #8)
> Well, not sure what you mean with the "include path" but I have YUI 3 and YUI 2
> in the webapp folder if that's what you mean. They contain a large amount of js
> files with lots of local variables.

That would be the project properties page that tells JSDT which folders and libraries to pay attention to.
Comment 10 Nitin Dahyabhai CLA 2011-06-06 03:05:04 EDT
(In reply to comment #8)
> Well, not sure what you mean with the "include path" but I have YUI 3 and YUI 2
> in the webapp folder if that's what you mean. They contain a large amount of js
> files with lots of local variables.

Everything seems fine when I unzip the Full Developer Kits for both 2.9.0 and 3.3.0 into the include path of the same project as the attached file and open it in the editor.  Is there a specific set of files I should be opening instead?  Do you have additional plug-ins installed over Indigo M7 (or RC3 by now)?
Comment 11 Marc CLA 2011-06-06 04:03:22 EDT
My Indigo installation was vanilla. However, the project I used was an existing one which uses among others maven, jdk6, subversion, Project Facets: Dynamic Web Module, Java, Javascript. That's about it. If you're taking this issue serious, I'd be happy to give you all the info you need.
Comment 12 Nitin Dahyabhai CLA 2011-06-06 08:18:30 EDT
Can you give more details of the project's layout, where the YUI .js files are located and what the .settings/.jsdtscope file contains, then?
Comment 13 Marc CLA 2011-06-06 08:31:12 EDT
Created attachment 197388 [details]
jsdtscope
Comment 14 Marc CLA 2011-06-06 08:32:48 EDT
yui files are located 
src/main/webapp/assets/js/yui-[version number]

All the js assets are in the js folder or a subdirectory thereof
Comment 15 Marc CLA 2011-06-06 08:34:09 EDT
Created attachment 197390 [details]
all the .settings folder
Comment 16 Nitin Dahyabhai CLA 2011-06-06 09:48:14 EDT
(In reply to comment #15)
> Created attachment 197390 [details]
> all the .settings folder

Not that I'm positive it's related, but you've got some duplicate and overlapping deployment settings in the org.eclipse.wst.common.component file as (I'm guessing) authored by the Maven integration.  Can you retry on a project that's not using Maven or FileSync?
Comment 17 Marc CLA 2011-06-06 09:57:44 EDT
If I create a new web project and open some fairly large Javascript files at the same time, I don't see the memory spiraling out of control. Memory use jumps with about 14 Megs for each file.
Comment 18 Nitin Dahyabhai CLA 2011-06-06 10:11:50 EDT
That's more like what I expected, but I'm still puzzled at how those two plug-ins could have the effect you saw on our editor.

Which update sites were used to install them?
Comment 20 Nitin Dahyabhai CLA 2011-06-06 13:31:53 EDT
Is the problematic project located on a remote disk, or checked out from SVN or Git?  I want to determine what ways is it different from a conventional new project created from scratch on a local disk directly under the workspace directory so I can work at isolating the cause.  Assuming it's one of them.
Comment 21 Marc CLA 2011-06-06 15:26:14 EDT
Checked out through svn on a local disk
Comment 22 Ronald So CLA 2013-05-13 14:38:43 EDT
I checked out my files from GIT and all files are local.  Copy and paste took forever to complete (5-10 seconds, sometimes 15 seconds).

Eclipse IDE for Javascript Web Developers
Indigo Service Release 2
Build Id: 20120216-1857

Same thing happened for SpringSource STS 2.9.1.

Both are running on CentOS 6.2.