当我尝试在浏览器上编译webapp时收到以下错误:
[ERROR] OutOfMemoryError: Increase heap size or lower gwt.jjs.maxThreads
java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Unknown Source)
at java.lang.AbstractStringBuilder.expandCapacity(Unknown Source)
at java.lang.AbstractStringBuilder.ensureCapacityInternal(Unknown Source)
at java.lang.AbstractStringBuilder.append(Unknown Source)
at java.lang.StringBuffer.append(Unknown Source)
at java.io.StringWriter.write(Unknown Source)
at java.io.PrintWriter.write(Unknown Source)
at java.io.PrintWriter.write(Unknown Source)
at java.io.PrintWriter.print(Unknown Source)
at com.google.gwt.dev.util.AbstractTextOutput.printAndCount(AbstractTextOutput.java:161)
at com.google.gwt.dev.util.AbstractTextOutput.print(AbstractTextOutput.java:117)
at com.google.gwt.dev.js.JsToStringGenerationVisitor._nameRef(JsToStringGenerationVisitor.java:1120)
at com.google.gwt.dev.js.JsToStringGenerationVisitor.visit(JsToStringGenerationVisitor.java:645)
at com.google.gwt.dev.js.ast.JsNameRef.traverse(JsNameRef.java:121)
at com.google.gwt.dev.js.ast.JsVisitor.doTraverse(JsVisitor.java:467)
at com.google.gwt.dev.js.ast.JsVisitor.doAccept(JsVisitor.java:444)
at com.google.gwt.dev.js.JsSourceGenerationVisitorWithSizeBreakdown.generateAndBill(JsSourceGenerationVisitorWithSizeBreakdown.java:71)
at com.google.gwt.dev.js.JsReportGenerationVisitor.generateAndBill(JsReportGenerationVisitor.java:109)
at com.google.gwt.dev.js.JsSourceGenerationVisitorWithSizeBreakdown.doAccept(JsSourceGenerationVisitorWithSizeBreakdown.java:63)
at com.google.gwt.dev.js.ast.JsVisitor.accept(JsVisitor.java:109)
at com.google.gwt.dev.js.JsToStringGenerationVisitor.visit(JsToStringGenerationVisitor.java:594)
at com.google.gwt.dev.js.ast.JsInvocation.traverse(JsInvocation.java:91)
at com.google.gwt.dev.js.ast.JsVisitor.doTraverse(JsVisitor.java:467)
at com.google.gwt.dev.js.ast.JsVisitor.doAccept(JsVisitor.java:444)
at com.google.gwt.dev.js.JsSourceGenerationVisitorWithSizeBreakdown.generateAndBill(JsSourceGenerationVisitorWithSizeBreakdown.java:71)
at com.google.gwt.dev.js.JsReportGenerationVisitor.generateAndBill(JsReportGenerationVisitor.java:109)
at com.google.gwt.dev.js.JsSourceGenerationVisitorWithSizeBreakdown.doAccept(JsSourceGenerationVisitorWithSizeBreakdown.java:63)
at com.google.gwt.dev.js.ast.JsVisitor.accept(JsVisitor.java:109)
at com.google.gwt.dev.js.JsToStringGenerationVisitor.visit(JsToStringGenerationVisitor.java:445)
at com.google.gwt.dev.js.ast.JsExprStmt.traverse(JsExprStmt.java:41)
at com.google.gwt.dev.js.ast.JsVisitor.doTraverse(JsVisitor.java:467)
at com.google.gwt.dev.js.ast.JsVisitor.doAccept(JsVisitor.java:444)
[ERROR] Out of memory; to increase the amount of memory, use the -Xmx flag at startup (java -Xmx128M ...)
[ERROR] Unrecoverable exception, shutting down
com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries)
at com.google.gwt.dev.ThreadedPermutationWorkerFactory$ThreadedPermutationWorker.compile(ThreadedPermutationWorkerFactory.java:56)
at com.google.gwt.dev.PermutationWorkerFactory$Manager$WorkerThread.run(PermutationWorkerFactory.java:74)
at java.lang.Thread.run(Unknown Source)
[ERROR] Not all permutation were compiled , completed (0/1)
[WARN] recompile failed
[WARN] continuing to serve previous version
我不明白为什么我收到此错误,因为我在Arguments,VM参数-Xmx1024m中修改了项目的运行配置。
另外,我的eclipse.ini看起来像这样:
-startup
../../../.p2/pool/plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar
--launcher.library
../../../.p2/pool/plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.300.v20150602-1417
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
--launcher.appendVmargs
-install
C:/Users/ANDREI/eclipse/jee-mars2/eclipse
-vm
C:/Program Files/Java/jre1.8.0_71/bin
-vmargs
-Dosgi.requiredJavaVersion=1.7
-Xms256m
-Xmx2048m
-Doomph.update.url=http://download.eclipse.org/oomph/updates/milestone/latest
-Doomph.redirection.index.redirection=index:/->http://git.eclipse.org/c/oomph/org.eclipse.oomph.git/plain/setups/
答案 0 :(得分:1)
尝试设置MaxPermSpace:-Xms512m -Xmx1024m -XX:MaxPermSize = 512m
答案 1 :(得分:0)
你有没有试过512 / 1024M以上的东西?我的设定在2-4g范围内......