Bug 347721 - [Helios] Frequent crashes with "Out of Memory Error" when working with JavaScript files in Java EE perspective
Summary: [Helios] Frequent crashes with "Out of Memory Error" when working with JavaSc...
Status: RESOLVED DUPLICATE of bug 345797
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Nitin Dahyabhai CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords: needinfo, performance
Depends on:
Blocks:
 
Reported: 2011-05-31 01:02 EDT by Tomasz Borek CLA
Modified: 2011-08-22 05:35 EDT (History)
2 users (show)

See Also:


Attachments
Long log, contains at least few sessions that ended in a crash (125.87 KB, text/plain)
2011-05-31 01:24 EDT, Tomasz Borek CLA
no flags Details
MAT report from recent crash (92.14 KB, application/octet-stream)
2011-05-31 01:29 EDT, Tomasz Borek CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tomasz Borek CLA 2011-05-31 01:02:22 EDT
Hi,

Wanted to get help with one bug I came across, that manifest itself when I work with JS files in Java EE perspective. Even basic operations (moving down or up through file, highlighting, copying code, etc.) quickly throw off internal error or unhandled loop exception. 

Noteworthy: 
1) doesn't happen if I use JSEclipse for JS files, but if I forgot to switch perspectives, boy, I'm in trouble quick. 
2) I extended heap space to 512. This 'only' prolongs time when Eclipse works furiously in the background just before crash.
3) See MAT, below.

> What steps will reproduce the problem?
Tricky one, as it did not occur immediately. I used to work with both JSEclipse and Java EE perspectives 'handling' JS files, and it was OK. My colleagues warned me against Java EE perspective, yet warnings sounded hollowe since nothing happened. They were surprised. Still, after three weeks with daily work being done in Eclipse, Java EE stopped being able to handle JS files. It's now often enough to open JavaScript file while in this perspective, to get sluggish responses, basic operations are delayed (even several seconds!) and crash happens sooner than later.

> MAT
I installed MAT (Memory Analyzer Tool) and *will attach it's report later*. It detected no leaking plug-ins installed, and found this (note, my code wasn't even working at the time, it's just Eclipse):

Used heap dump 500,4 MB 
Number of objects 11 109 831 
Number of classes 20 373 
Number of class loaders 292 
Number of GC roots 2 376 
Format hprof 
JVM version  
Time 17:51:04 CEST 
Date 30-05-2011 
Identifier size 32-bit 
File path C:\Program Files\eclipse-jee-helios-SR1-win32\eclipse\java_pid2872.hprof 
File length 601 720 328 


Classes 
1) org.eclipse.wst.jsdt.internal.ui.javaeditor.ASTProvider @ 0x11359b78 
2) org.eclipse.jface.text.TextViewerHoverManager$4 @ 0x1b7a32f8 Text Viewer Hover Presenter Thread 

took respectively 245,8 and 147,8 MBs of heap. These are primary suspects for leaks.

I will also *attach Eclipse error log later today*.

-- Error Details --
Date: Mon May 30 16:28:45 CEST 2011
Message: Internal Error
Severity: Error
Product: Eclipse 1.3.2.20110218-0812 (org.eclipse.epp.package.jee.product)
Plugin: org.eclipse.wst.jsdt.ui
Session Data:
eclipse.buildId=M20110210-1200
java.version=1.6.0_22
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=pl_PL
Framework arguments:  -showlocation -product org.eclipse.epp.package.jee.product
Command-line arguments:  -os win32 -ws win32 -arch x86 -showlocation -product org.eclipse.epp.package.jee.product


Exception Stack Trace:
java.lang.reflect.InvocationTargetException
at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:421)
at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:507)
at org.eclipse.ui.internal.progress.ProgressMonitorJobsDialog.run(ProgressMonitorJobsDialog.java:275)
at org.eclipse.ui.internal.progress.ProgressManager$5.run(ProgressManager.java:960)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.ui.internal.progress.ProgressManager.busyCursorWhile(ProgressManager.java:995)
at org.eclipse.ui.internal.progress.ProgressManager.busyCursorWhile(ProgressManager.java:970)
at org.eclipse.wst.jsdt.internal.ui.actions.SelectionConverter.performForkedCodeResolve(SelectionConverter.java:204)
at org.eclipse.wst.jsdt.internal.ui.actions.SelectionConverter.codeResolveForked(SelectionConverter.java:131)
at org.eclipse.wst.jsdt.ui.actions.OpenAction.run(OpenAction.java:130)
at org.eclipse.wst.jsdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:249)
at org.eclipse.wst.jsdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:221)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
at org.eclipse.ui.commands.ActionHandler.execute(ActionHandler.java:185)
at org.eclipse.ui.internal.handlers.LegacyHandlerWrapper.execute(LegacyHandlerWrapper.java:109)
at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:468)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:786)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:885)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:567)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:508)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:123)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1253)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1052)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1103)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1099)
at org.eclipse.swt.widgets.Widget.wmKeyDown(Widget.java:1808)
at org.eclipse.swt.widgets.Control.WM_KEYDOWN(Control.java:4498)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:4193)
at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4873)
at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2459)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3655)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:620)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
at org.eclipse.equinox.launcher.Main.run(Main.java:1408)
at org.eclipse.equinox.launcher.Main.main(Main.java:1384)
Caused by: java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:2760)
at java.util.Arrays.copyOf(Arrays.java:2734)
at java.util.ArrayList.ensureCapacity(ArrayList.java:167)
at java.util.ArrayList.add(ArrayList.java:351)
at org.eclipse.wst.jsdt.core.infer.InferredType.addMethod(InferredType.java:261)
at org.eclipse.wst.jsdt.core.infer.InferredType.addMethod(InferredType.java:228)
at org.eclipse.wst.jsdt.core.infer.InferEngine.populateType(InferEngine.java:1302)
at org.eclipse.wst.jsdt.core.infer.InferEngine.createAnonymousType(InferEngine.java:668)
at org.eclipse.wst.jsdt.core.infer.InferEngine.visit(InferEngine.java:2070)
at org.eclipse.wst.jsdt.internal.compiler.DelegateASTVisitor.visit(DelegateASTVisitor.java:855)
at org.eclipse.wst.jsdt.internal.compiler.ast.ObjectLiteral.traverse(ObjectLiteral.java:66)
at org.eclipse.wst.jsdt.internal.compiler.ast.MessageSend.traverse(MessageSend.java:459)
at org.eclipse.wst.jsdt.internal.compiler.ast.MethodDeclaration.traverse(MethodDeclaration.java:174)
at org.eclipse.wst.jsdt.internal.compiler.ast.FunctionExpression.traverse(FunctionExpression.java:48)
at org.eclipse.wst.jsdt.internal.compiler.ast.MessageSend.traverse(MessageSend.java:455)
at org.eclipse.wst.jsdt.internal.compiler.ast.CompilationUnitDeclaration.traverse(CompilationUnitDeclaration.java:584)
at org.eclipse.wst.jsdt.internal.compiler.ast.CompilationUnitDeclaration.traverse(CompilationUnitDeclaration.java:539)
at org.eclipse.wst.jsdt.core.infer.InferEngine.doInfer(InferEngine.java:1745)
at org.eclipse.wst.jsdt.internal.compiler.parser.Parser.inferTypes(Parser.java:7093)
at org.eclipse.wst.jsdt.internal.codeassist.SelectionEngine.doParse(SelectionEngine.java:1275)
at org.eclipse.wst.jsdt.internal.codeassist.impl.Engine.accept(Engine.java:84)
at org.eclipse.wst.jsdt.internal.compiler.lookup.LookupEnvironment.addUnitsContainingBinding(LookupEnvironment.java:170)
at org.eclipse.wst.jsdt.internal.compiler.lookup.CompilationUnitScope.buildTypeBindings(CompilationUnitScope.java:342)
at org.eclipse.wst.jsdt.internal.compiler.lookup.LookupEnvironment.buildTypeBindings(LookupEnvironment.java:244)
at org.eclipse.wst.jsdt.internal.codeassist.impl.Engine.accept(Engine.java:86)
at org.eclipse.wst.jsdt.internal.compiler.lookup.LookupEnvironment.askForBinding(LookupEnvironment.java:205)
at org.eclipse.wst.jsdt.internal.compiler.lookup.PackageBinding.getTypeOrPackage(PackageBinding.java:249)
at org.eclipse.wst.jsdt.internal.compiler.lookup.Scope.getTypeOrPackage(Scope.java:2115)
at org.eclipse.wst.jsdt.internal.compiler.lookup.Scope.getType(Scope.java:1878)
at org.eclipse.wst.jsdt.core.infer.InferredType.resolveSuperType(InferredType.java:367)
at org.eclipse.wst.jsdt.internal.compiler.lookup.ClassScope.findInferredSupertype(ClassScope.java:726)
at org.eclipse.wst.jsdt.internal.compiler.lookup.ClassScope.connectSuperclass(ClassScope.java:483)
Root exception:
java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:2760)
at java.util.Arrays.copyOf(Arrays.java:2734)
at java.util.ArrayList.ensureCapacity(ArrayList.java:167)
at java.util.ArrayList.add(ArrayList.java:351)
at org.eclipse.wst.jsdt.core.infer.InferredType.addMethod(InferredType.java:261)
at org.eclipse.wst.jsdt.core.infer.InferredType.addMethod(InferredType.java:228)
at org.eclipse.wst.jsdt.core.infer.InferEngine.populateType(InferEngine.java:1302)
at org.eclipse.wst.jsdt.core.infer.InferEngine.createAnonymousType(InferEngine.java:668)
at org.eclipse.wst.jsdt.core.infer.InferEngine.visit(InferEngine.java:2070)
at org.eclipse.wst.jsdt.internal.compiler.DelegateASTVisitor.visit(DelegateASTVisitor.java:855)
at org.eclipse.wst.jsdt.internal.compiler.ast.ObjectLiteral.traverse(ObjectLiteral.java:66)
at org.eclipse.wst.jsdt.internal.compiler.ast.MessageSend.traverse(MessageSend.java:459)
at org.eclipse.wst.jsdt.internal.compiler.ast.MethodDeclaration.traverse(MethodDeclaration.java:174)
at org.eclipse.wst.jsdt.internal.compiler.ast.FunctionExpression.traverse(FunctionExpression.java:48)
at org.eclipse.wst.jsdt.internal.compiler.ast.MessageSend.traverse(MessageSend.java:455)
at org.eclipse.wst.jsdt.internal.compiler.ast.CompilationUnitDeclaration.traverse(CompilationUnitDeclaration.java:584)
at org.eclipse.wst.jsdt.internal.compiler.ast.CompilationUnitDeclaration.traverse(CompilationUnitDeclaration.java:539)
at org.eclipse.wst.jsdt.core.infer.InferEngine.doInfer(InferEngine.java:1745)
at org.eclipse.wst.jsdt.internal.compiler.parser.Parser.inferTypes(Parser.java:7093)
at org.eclipse.wst.jsdt.internal.codeassist.SelectionEngine.doParse(SelectionEngine.java:1275)
at org.eclipse.wst.jsdt.internal.codeassist.impl.Engine.accept(Engine.java:84)
at org.eclipse.wst.jsdt.internal.compiler.lookup.LookupEnvironment.addUnitsContainingBinding(LookupEnvironment.java:170)
at org.eclipse.wst.jsdt.internal.compiler.lookup.CompilationUnitScope.buildTypeBindings(CompilationUnitScope.java:342)
at org.eclipse.wst.jsdt.internal.compiler.lookup.LookupEnvironment.buildTypeBindings(LookupEnvironment.java:244)
at org.eclipse.wst.jsdt.internal.codeassist.impl.Engine.accept(Engine.java:86)
at org.eclipse.wst.jsdt.internal.compiler.lookup.LookupEnvironment.askForBinding(LookupEnvironment.java:205)
at org.eclipse.wst.jsdt.internal.compiler.lookup.PackageBinding.getTypeOrPackage(PackageBinding.java:249)
at org.eclipse.wst.jsdt.internal.compiler.lookup.Scope.getTypeOrPackage(Scope.java:2115)
at org.eclipse.wst.jsdt.internal.compiler.lookup.Scope.getType(Scope.java:1878)
at org.eclipse.wst.jsdt.core.infer.InferredType.resolveSuperType(InferredType.java:367)
at org.eclipse.wst.jsdt.internal.compiler.lookup.ClassScope.findInferredSupertype(ClassScope.java:726)
at org.eclipse.wst.jsdt.internal.compiler.lookup.ClassScope.connectSuperclass(ClassScope.java:483)


PS. I can't get into Eclipsepedia to see keywords, so some of them might later change, once server will reply.
Comment 1 Tomasz Borek CLA 2011-05-31 01:24:21 EDT
Created attachment 196958 [details]
Long log, contains at least few sessions that ended in a crash

CFEclipse warnings can be safely ignored:
http://groups.google.com/group/cfeclipse-users/browse_thread/thread/21d48af5836e8ac4?pli=1

PermGen fix with launcher args off and using VMargs also does not change a thing (not that I thought it will):
 https://bugs.eclipse.org/bugs/show_bug.cgi?id=203325
Comment 2 Tomasz Borek CLA 2011-05-31 01:29:46 EDT
Created attachment 196959 [details]
MAT report from recent crash

In case heap space was the problem, I did the following:
- tried extending it via vmargs (ini file) to 512MB
- installed MAT
- added -XX:+HeapDumpOnOutOfMemoryError to have heap dumps when running eclipse (ini file again)
- ran MAT against the dump to have the leak suspects report
Comment 3 Nitin Dahyabhai CLA 2011-05-31 11:52:28 EDT
Sounds like a duplicate of bug 345797.
Comment 4 Tomasz Borek CLA 2011-06-01 04:13:37 EDT
Thank you Nitin.
Comment 5 Chris Jaun CLA 2011-06-29 15:21:58 EDT
(In reply to comment #3)
> Sounds like a duplicate of bug 345797.

Can this be closed now? Was it a duplicate?
Comment 6 Tomasz Borek CLA 2011-08-22 05:35:13 EDT
Yes, that seems a dupe, and even though the other bug does not resolve this issue, this can be closed. Sorry for delay in answering.

regards,
Tomasz

*** This bug has been marked as a duplicate of bug 345797 ***