Bug 390725 - java.lang.OutOfMemoryError when opening HTML file (codeSelect)
Summary: java.lang.OutOfMemoryError when opening HTML file (codeSelect)
Status: NEW
Alias: None
Product: JSDT
Classification: WebTools
Component: Web (show other bugs)
Version: unspecified   Edit
Hardware: Macintosh Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Chris Jaun CLA
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2012-09-28 14:51 EDT by Jacob Weber CLA
Modified: 2013-06-19 11:10 EDT (History)
3 users (show)

See Also:


Attachments
jstack output (89.70 KB, text/plain)
2012-09-28 14:51 EDT, Jacob Weber CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jacob Weber CLA 2012-09-28 14:51:30 EDT
Created attachment 221675 [details]
jstack output

When I opened a small (50 lines or so) HTML file, containing a block of JavaScript, Eclipse hang for about 30 seconds, then gave me an out-of-memory error and asked me to quit. The error from Error Log is below; I'm also attaching several jstack calls made while it was hanging. The last one is after it reported the error.



Unhandled event loop exception

java.lang.OutOfMemoryError: Java heap space
	at org.eclipse.wst.jsdt.internal.compiler.parser.Scanner.getLineEnds(Scanner.java:534)
	at org.eclipse.wst.jsdt.internal.compiler.parser.Parser.problemReporter(Parser.java:6335)
	at org.eclipse.wst.jsdt.internal.compiler.parser.Parser.consumeToken(Parser.java:4385)
	at org.eclipse.wst.jsdt.internal.compiler.parser.Parser.parse(Parser.java:5740)
	at org.eclipse.wst.jsdt.internal.compiler.parser.Parser.parse(Parser.java:6036)
	at org.eclipse.wst.jsdt.internal.compiler.parser.Parser.parse(Parser.java:5988)
	at org.eclipse.wst.jsdt.internal.codeassist.SelectionEngine.doParse(SelectionEngine.java:1286)
	at org.eclipse.wst.jsdt.internal.codeassist.impl.Engine.accept(Engine.java:91)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.LookupEnvironment.askForBinding(LookupEnvironment.java:279)
	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:2105)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.Scope.getType(Scope.java:1876)
	at org.eclipse.wst.jsdt.core.infer.InferredType.resolveType(InferredType.java:319)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.MethodScope.createMethod(MethodScope.java:192)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.MethodScope.createMethod(MethodScope.java:166)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.SourceTypeBinding.buildMethods(SourceTypeBinding.java:204)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.SourceTypeBinding.buildFieldsAndMethods(SourceTypeBinding.java:77)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.CompilationUnitScope.buildFieldsAndMethods(CompilationUnitScope.java:186)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.LookupEnvironment.completeTypeBindings(LookupEnvironment.java:470)
	at org.eclipse.wst.jsdt.internal.codeassist.impl.Engine.accept(Engine.java:94)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.LookupEnvironment.askForBinding(LookupEnvironment.java:279)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.PackageBinding.getBinding(PackageBinding.java:156)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.Scope.findBinding(Scope.java:802)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.Scope.findType(Scope.java:821)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.CompilationUnitScope.buildSuperType(CompilationUnitScope.java:413)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.CompilationUnitScope.buildTypeBindings(CompilationUnitScope.java:382)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.LookupEnvironment.buildTypeBindings(LookupEnvironment.java:320)
	at org.eclipse.wst.jsdt.internal.compiler.lookup.LookupEnvironment.buildTypeBindings(LookupEnvironment.java:316)
	at org.eclipse.wst.jsdt.internal.codeassist.SelectionEngine.select(SelectionEngine.java:729)
	at org.eclipse.wst.jsdt.internal.core.Openable.codeSelect(Openable.java:167)
	at org.eclipse.wst.jsdt.internal.core.CompilationUnit.codeSelect(CompilationUnit.java:318)
	at org.eclipse.wst.jsdt.web.core.javascript.JsTranslation.getElementsFromJsRange(JsTranslation.java:302)
Comment 1 Jacob Weber CLA 2012-09-28 14:54:03 EDT
This is Eclipse Juno 20120614-1722, installed from eclipse-jee-juno-macosx-cocoa-x86_64.tar, with all plugins up-to-date.
Comment 2 Nitin Dahyabhai CLA 2012-09-28 15:03:02 EDT
Try increasing the maximum memory.  The default of 512MB may not cover your usage.
Comment 3 Jacob Weber CLA 2012-09-28 15:07:09 EDT
I can try that, but the long delay before the out-of-memory error makes me think that this was an out-of-control loop, rather than just a normal case of not enough memory.
Comment 4 Nitin Dahyabhai CLA 2012-10-18 14:20:05 EDT
It might be better in Juno SR1 in that the problematic calls are less frequent, but it is still possible without tweaking your memory settings.  Were you able to try it with a larger heap size?