2

我第一次使用http://typesafe.com/stack/,并创建了简单的 akka 项目。我的 scala 版本是 2.9.2 我收到以下错误。

[info] Done updating.
[info] Compiling 1 Scala source to /Users/hrishikeshparanjape/git-public/web-service/target/scala-2.9.2/classes...
[info] 'compiler-interface' not yet compiled for Scala 2.9.2. Compiling...
sbt appears to be exiting abnormally.
  The log file for this session is at /var/folders/26/hqgjyf0j7192hmjdsz17f3v80000gn/T/sbt2587622650679130928.log
java.lang.OutOfMemoryError: PermGen space
    at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222)
    at java.util.concurrent.FutureTask.get(FutureTask.java:83)
    at sbt.CompletionService$$anon$1.take(CompletionService.scala:29)
    at sbt.Execute.next$1(Execute.scala:74)
    at sbt.Execute.processAll(Execute.scala:77)
    at sbt.Execute.runKeep(Execute.scala:57)
    at sbt.EvaluateTask$.run$1(EvaluateTask.scala:109)
    at sbt.EvaluateTask$.runTask(EvaluateTask.scala:124)
    at sbt.Aggregation$$anonfun$7.apply(Aggregation.scala:87)
    at sbt.Aggregation$$anonfun$7.apply(Aggregation.scala:85)
    at sbt.EvaluateTask$.withStreams(EvaluateTask.scala:87)
    at sbt.Aggregation$.runTasks(Aggregation.scala:85)
    at sbt.Aggregation$$anonfun$applyDynamicTasks$1.apply(Aggregation.scala:141)
    at sbt.Aggregation$$anonfun$applyDynamicTasks$1.apply(Aggregation.scala:136)
    at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:64)
    at sbt.Command$$anonfun$applyEffect$2$$anonfun$apply$3.apply(Command.scala:64)
    at sbt.Command$.process(Command.scala:92)
    at sbt.MainLoop$$anonfun$next$1$$anonfun$apply$1.apply(Main.scala:121)
    at sbt.MainLoop$$anonfun$next$1$$anonfun$apply$1.apply(Main.scala:121)
    at sbt.State$$anon$1.process(State.scala:154)
    at sbt.MainLoop$$anonfun$next$1.apply(Main.scala:121)
    at sbt.MainLoop$$anonfun$next$1.apply(Main.scala:121)
    at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
    at sbt.MainLoop$.next(Main.scala:121)
    at sbt.MainLoop$.run(Main.scala:114)
    at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(Main.scala:103)
    at sbt.MainLoop$$anonfun$runWithNewLog$1.apply(Main.scala:100)
    at sbt.Using.apply(Using.scala:25)
    at sbt.MainLoop$.runWithNewLog(Main.scala:100)
    at sbt.MainLoop$.runAndClearLast(Main.scala:83)
    at sbt.MainLoop$.runLoggedLoop(Main.scala:67)
    at sbt.MainLoop$.runLogged(Main.scala:60)
Error during sbt execution: java.lang.OutOfMemoryError: PermGen space

请帮忙。

4

1 回答 1

5

您的项目需要更多内存才能执行(这就是java.lang.OutOfMemoryError: PermGen space告诉您的内容)。我从来没有使用过类型安全堆栈,因此我不知道是否可以直接配置内存参数。

但是如果你运行 Linux,你可以输入

env JAVA_OPTS="-Xms512m -Xmx1024m -Xss1M -XX:MaxPermSize=512" <command>

其中 command 是执行项目的命令(可能是sbt)。当然,如果您需要更多/更少的空间,您可以更改参数的大小。

于 2012-07-26T08:01:14.683 回答