Closed axaluss closed 12 years ago
My sbt invokation currently looks like this:
java -Xmx2048M -jar dirname $0
/sbt-launch-0.7.7.jar "$@"
Where -Xmx sets the maximum heap size. It's currently working to compile Scalala under OSX (1.6.0_24 64-bit server JVM), although under OSX I can also get away with a heap size of 1024M (which you seem to have above). Does increasing the heap size fix the problem?
I am using this sbt.cmd file: set SCRIPT_DIR=%~dp0 java %SBT_OPTS% -Dfile.encoding=UTF-8 -Xss4M -Xmx1024M -XX:MaxPermSize=512M -XX:NewSize=512M -XX:NewRatio=3 -jar "%SCRIPT_DIR%\project\sbt-launch-0.7.5.jar" %*
and this is my sbt:
java $SBT_OPTS -Dfile.encoding=UTF-8 -Xss4M -Xmx1024M -XX:MaxPermSize=512M -XX:NewSize=512M -XX:NewRatio=3 -jar dirname $0
/project/sbt-launch-0.7.5.jar "$@"
I dont have any clue why this does not work
Furthermore the java process somehow stays under 300MB size all the time. I dont get that. Now it says:
java.lang.OutOfMemoryError: Java heap space at scala.tools.nsc.util.HashSet.growTable(HashSet.scala:93) at scala.tools.nsc.util.HashSet.findEntryOrUpdate(HashSet.scala:38) at scala.tools.nsc.symtab.Types$class.scala$tools$nsc$symtab$Types$$unique(Types.scala:2804) at scala.tools.nsc.symtab.Types$class.typeRef(Types.scala:2599) at scala.tools.nsc.symtab.SymbolTable.typeRef(SymbolTable.scala:13) at scala.tools.nsc.symtab.Symbols$TypeSymbol.typeConstructor(Symbols.scala:1840) at scala.tools.nsc.symtab.Symbols$Symbol.tpeHK(Symbols.scala:896) at scala.tools.nsc.symtab.Types$ExistentialType$$anonfun$10.apply(Types.scala:2136) at scala.tools.nsc.symtab.Types$ExistentialType$$anonfun$10.apply(Types.scala:2136) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:206) at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:206) at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:61) at scala.collection.immutable.List.foreach(List.scala:45) at scala.collection.TraversableLike$class.map(TraversableLike.scala:206) at scala.collection.immutable.List.map(List.scala:45) at scala.tools.nsc.symtab.Types$ExistentialType.withTypeVars(Types.scala:2136) at scala.tools.nsc.symtab.Types$class.thirdTry$1(Types.scala:4495) at scala.tools.nsc.symtab.Types$class.secondTry$1(Types.scala:4453) at scala.tools.nsc.symtab.Types$class.firstTry$1(Types.scala:4430) at scala.tools.nsc.symtab.Types$class.scala$tools$nsc$symtab$Types$$isSubType2(Types.scala:4569) at scala.tools.nsc.symtab.Types$$anonfun$isSubType$1.apply$mcZ$sp(Types.scala:4284) at scala.tools.nsc.symtab.Types$undoLog$.undoUnless(Types.scala:127) at scala.tools.nsc.symtab.Types$class.isSubType(Types.scala:4271) at scala.tools.nsc.symtab.SymbolTable.isSubType(SymbolTable.scala:13) at scala.tools.nsc.symtab.Types$Type.$less$colon$less(Types.scala:601) at scala.tools.nsc.symtab.Types$class.isSubArgs(Types.scala:4369) at scala.tools.nsc.symtab.SymbolTable.isSubArgs(SymbolTable.scala:13) at scala.tools.nsc.symtab.Types$class.firstTry$1(Types.scala:4407) at scala.tools.nsc.symtab.Types$class.scala$tools$nsc$symtab$Types$$isSubType2(Types.scala:4569) at scala.tools.nsc.symtab.Types$$anonfun$isSubType$1.apply$mcZ$sp(Types.scala:4284) at scala.tools.nsc.symtab.Types$undoLog$.undoUnless(Types.scala:127) at scala.tools.nsc.symtab.Types$class.isSubType(Types.scala:4271) Error during sbt execution: java.lang.OutOfMemoryError: Java heap space
instead of:
java.lang.OutOfMemoryError: Java heap space
at scala.Tuple2$Zipped.map(Tuple2.scala:63)
at scala.tools.nsc.symtab.Types$TypeMap.mapOver(Types.scala:3134)
at scala.tools.nsc.symtab.Types$TypeMap.mapOver(Types.scala:3024)
at scala.tools.nsc.symtab.Types$SubstMap.apply(Types.scala:3455)
and before it took longer before it crashed.
As lancelet says, I'd say -Xmx to 2048M before anything else.
with 2048M again the same error as the last time. it takes less than 2 minutes to fail with permanentely less than 300 MB usage with a java.lang.OutOfMemoryError: Java heap space at scala.tools.nsc.util.HashSet.growTable(HashSet.scala:93) at scala.tools.nsc.util.HashSet.findEntryOrUpdate(HashSet.scala:38) .....
Any ideas?
I can only test under OSX, and the compile is currently working for my setup (OSX 10.6.7, Java version 1.6.0_24 64-bit server VM, compiling with sbt 0.7.7 for Scala 2.9.0).
What OS are you using, what JVM, and what version of Scala are you compiling for, and are you using the packaged sbt or some other version? Maybe someone can replicate your setup and look into it?
Going to re-close this issue for now, as it doesn't seem to be a scalala problem as much as a sbt / java / scala config problem for axaluss. The default ./sbt invocation seems to work fine for many folks' configurations. If you find one that
read the question on http://stackoverflow.com/questions/6136946/sbt-heapsize-not-enough.
i get a heap size exception.