Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 329978

Summary: [performance] Java heap space error on editing files with JavaScript code
Product: [WebTools] JSDT Reporter: Nimruhil <nimruhil>
Component: GeneralAssignee: Project Inbox <jsdt.javascript-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: thatnitind
Version: unspecified   
Target Milestone: 3.2.5   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
"java heap space" error log
none
"GC overhead limit exceeded" error log none

Description Nimruhil CLA 2010-11-11 04:56:09 EST
While I'm editing source code, that contains JavaScript (no matter is there only JavaScript, JavaScript in HTML code or JavaScript in PHP code), Eclipse gets frozen and then "Java heap space" error occurs. This problem is the same in PHP and JavaScript perspectives. Problem disappears if JavaScript support is disabled on project. But in this case I haven't JavaScript code assist.
Comment 1 xu jiaxi CLA 2010-11-16 00:17:27 EST
Hi Nimruhil,
Can you attach some sample code or project that can reproduce this bug? Thanks.
Comment 2 Nimruhil CLA 2010-11-16 06:25:29 EST
(In reply to comment #1)
> Hi Nimruhil,
> Can you attach some sample code or project that can reproduce this bug? Thanks.

Unfortunately I can't because the project problem occures on too large. In addition i'd have a problem on my work if i share it.
I've got some files from that project and put them to separate project. Bug doesn't occurs on this small project. Seemingly there should be a lot of code in project for reproducing this error.
Anyway i've made some more observations regarding this error. It occurs not only when editing code. Often i got it when Eclipse building workspace. Several times i got a "GC overhead" error. Also Eclipse slows down when JavaScript support enabled. It seems like Eclipse makes some indexes (or something like this) for JavaScript code and this indexes are too large. So Eclipse overflows memory of java machine.
Comment 3 Nimruhil CLA 2010-11-16 06:43:02 EST
Created attachment 183214 [details]
"java heap space" error log

Occured on building workspace
Comment 4 Nimruhil CLA 2010-11-16 06:44:30 EST
Created attachment 183215 [details]
"GC overhead limit exceeded" error log

Occured on building workspace
Comment 5 xu jiaxi CLA 2010-11-17 00:21:14 EST
In the log, I can't see any code of PDT. So I'm not sure what's the problem.

I suggest you to increase the Eclipse's startup min/max memory settings.
Comment 6 Nimruhil CLA 2010-11-18 05:47:43 EST
(In reply to comment #5)
> I suggest you to increase the Eclipse's startup min/max memory settings.

Value of --launcher.XXMaxPermSize parameter in my eclipse.ini file is 256m. In spite of this size of javaw.exe process is 500+ Mb usually. Sometimes it reaches 600+Mb.
Anyway i tried to increase the value of --launcher.XXMaxPermSize parameter to 512Mb and then to 1024Mb. The only apparent result of this was an increasing of time interval between moments when Eclipse starts slowing down and when it throws an error.
Comment 7 Zhongwei Zhao CLA 2011-04-15 01:46:25 EDT
move to JSDT
Comment 8 Nitin Dahyabhai CLA 2011-06-06 12:01:17 EDT
(In reply to comment #6)
> (In reply to comment #5)
> > I suggest you to increase the Eclipse's startup min/max memory settings.
> 
> Value of --launcher.XXMaxPermSize parameter in my eclipse.ini file is 256m. In
> spite of this size of javaw.exe process is 500+ Mb usually. Sometimes it
> reaches 600+Mb.
> Anyway i tried to increase the value of --launcher.XXMaxPermSize parameter to
> 512Mb and then to 1024Mb. The only apparent result of this was an increasing of
> time interval between moments when Eclipse starts slowing down and when it
> throws an error.

That parameter controls the maximum amount of memory for Permanent Generation, a value separate from that which controls the Heap size.  What's the maximum allowed heap size?
Comment 9 Nitin Dahyabhai CLA 2011-06-30 15:30:54 EDT
Resolving since I think the max heap size wasn't properly increased, and we've done other work to reduce our heap usage.