OutOfMemoryError on webdsl build of researchr
OutOfMemoryError on webdsl build of researchr
Also note the build times
webdslc arguments: –servlet -i ../researchr.app –session-timeout 120 –enable-caching 1 –dir /Users/eelcovisser/researchr/trunk/.servletapp
Directory: /Users/eelcovisser/researchr/trunk/.servletapp
Java options: -Xss8m -Xmx1024m
Classpath: /Applications/eclipse3/plugins/webdsl.editor_1.2.7.2/include/webdsl.jar, /Applications/eclipse3/plugins/webdsl.editor_1.2.7.2/webdsl-template/template-java-servlet/lib/strategoxt.jar
[ Main | info ] stage 1: parsing researchr.app : [user/system] = [2.34s/0.00s]
[ Main | info ] stage 2: importing modules : [user/system] = [27.22s/0.00s]
[ Main | info ] stage 3: typechecking : [user/system] = [20.43s/0.00s]
[ Main | info ] stage 4: model-to-model : [user/system] = [41.63s/0.00s]
[ Main | info ] stage 5: access control
Access control warning: access to element always denied: page classificationtableOld(bib : Bibliography)
Access control warning: unused rules:
rule action deselect()
rule action parseReferences()
: [user/system] = [52.74s/0.00s]
[ Main | info ] stage 6: performing analysis : [user/system] = [1.59s/0.00s]
[ Main | info ] stage 7: renaming identifiers : [user/system] = [1.56s/0.00s]
[ Main | info ] stage 8: generation analysis : [user/system] = [0.08s/0.00s]
[ Main | info ] stage 9: code generation : [user/system] = [704.54s/0.00s]
[ Main | info ] stage 10: writing files : [user/system] = [3.25s/0.00s]
Now compiling generated Java codeCopying 1 file to /Users/eelcovisser/researchr/trunk/.servletapp/src-template
Copying 1 file to /Users/eelcovisser/researchr/trunk/.servletapp/src-template
Copying 1 file to /Users/eelcovisser/researchr/trunk/.servletapp/src-template
configuring for using Mysql database
Copying 1 file to /Users/eelcovisser/researchr/trunk/.servletapp/src-template/Users/eelcovisser/researchr/trunk/.servletapp/build.xml:79: warning: ‘includeantruntime’ was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
Submitted by Eelco Visser on 18 February 2011 at 18:09
Compiling 7522 source files to /Users/eelcovisser/researchr/trunk/.servletapp/WEB-INF/classes
The system is out of resources.
Consult the following stack trace for details.
java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOfRange(Arrays.java:3209)
at java.lang.String.(String.java:215)
at java.lang.StringBuilder.toString(StringBuilder.java:430)
at com.sun.tools.javac.zip.ZipFileIndexEntry.getName(ZipFileIndexEntry.java:48)
at com.sun.tools.javac.util.DefaultFileManager$ZipFileIndexFileObject.getZipEntryName(DefaultFileManager.java:1611)
at com.sun.tools.javac.util.DefaultFileManager.inferBinaryName(DefaultFileManager.java:909)
at com.sun.tools.javac.jvm.ClassReader.fillIn(ClassReader.java:2155)
at com.sun.tools.javac.jvm.ClassReader.fillIn(ClassReader.java:2130)
at com.sun.tools.javac.jvm.ClassReader.complete(ClassReader.java:1781)
at com.sun.tools.javac.code.Symbol.complete(Symbol.java:386)
at com.sun.tools.javac.jvm.ClassReader.completeOwners(ClassReader.java:1793)
at com.sun.tools.javac.jvm.ClassReader.complete(ClassReader.java:1772)
Issue Log
This looks like
javac
running out of memory on compiling the generated code, unfortunately, it’s already at the highest max memory setting possible that’s supported on all systems (setting it too high will cause compilation to not start at all). Your laptop probably allows higher settings, try
editing.servletapp/build.xml
and increasingmemorymaximumsize
. You can also uncomment<compilerarg value="-J-XX:+UseCompressedOops"/>
(again, not supported for everyjavac
).
Then runcd .servletapp ant build (and/or ant deploy)
That will just compile/deploy the generated Java code.
Another option is to use the Java compiler in Eclipse (
ecj
), which is faster and uses less memory. Building the WebDSL project in Eclipse will useecj
.Now that it is possible to run the plugin compiler on the command-line, the next step will be tweaking build.xml to allow usage of
ecj
instead ofjavac
for compilation in such headless builds.
Increasing the memory size works; it would be good to make that configurable via application.ini, since the build.xml is overwritten on each compile, I assume? Hopefully, incremental compiles will work faster during development.
I’ve added an option for setting javac max memory in application.ini in r4531
example:
javacmem=3G
That solves the issue then, I suppose. It would be good of course to reduce the size of generated code so that less memory is required.
Log in to post comments