首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >OutofmemoryError: PermGen on play 2.2.2

OutofmemoryError: PermGen on play 2.2.2
EN

Stack Overflow用户
提问于 2014-05-27 11:28:16
回答 1查看 781关注 0票数 0

我使用激活器(Typesafe activator 1.1.1)创建了一个简单的播放项目(hello- play )。

我的sbt脚本如下所示

代码语言:javascript
复制
SBT_OPTS="-Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256M" java $SBT_OPTS -jar `dirname $0`/sbt-launch.jar "$@"

当我运行sbt play时,我的服务器在localhost:9000上正确启动。但是,当我对其中一个scala源文件进行简单更改并再次单击该页面时,会出现以下错误。

注意:我不确定这是否是从命令行运行play应用程序的正确方式,因为它最初是使用activator创建的。

代码语言:javascript
复制
$sbt play
[info] Loading project definition from /Users/ssimanta/hello-play/project
[info] Set current project to hello-play (in build file:/Users/ssimanta/hello-play/)
       _
 _ __ | | __ _ _  _
| '_ \| |/ _' | || |
|  __/|_|\____|\__ /
|_|            |__/

play 2.2.2 built with Scala 2.10.3 (running Java 1.7.0_45), http://www.playframework.com

> Type "help play" or "license" for more information.
> Type "exit" or use Ctrl+D to leave this console.

[hello-play] $ run

--- (Running the application from SBT, auto-reloading is enabled) ---

[info] play - Listening for HTTP on /0:0:0:0:0:0:0:0:9000

(Server started, use Ctrl+D to stop and go back to the console...)

[info] Compiling 1 Scala source to /Users/ssimanta/hello-play/target/scala-2.10/classes...
[info] play - Application started (Dev)
[info] Compiling 1 Scala source to /Users/ssimanta/hello-play/target/scala-2.10/classes...
[error] application - 

! Internal server error, for (GET) [/message] ->

java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: PermGen space
    at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[na:1.7.0_45]
    at java.util.concurrent.FutureTask.get(FutureTask.java:188) ~[na:1.7.0_45]
    at sbt.ConcurrentRestrictions$$anon$4.take(ConcurrentRestrictions.scala:196) ~[na:na]
    at sbt.Execute.next$1(Execute.scala:88) ~[na:na]
    at sbt.Execute.processAll(Execute.scala:91) ~[na:na]
    at sbt.Execute.runKeep(Execute.scala:69) ~[na:na]
java.lang.OutOfMemoryError: PermGen space
    at java.lang.ClassLoader.defineClass1(Native Method) ~[na:1.7.0_45]
    at java.lang.ClassLoader.defineClass(ClassLoader.java:800) ~[na:1.7.0_45]
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) ~[na:1.7.0_45]
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) ~[na:1.7.0_45]
    at java.net.URLClassLoader.access$100(URLClassLoader.java:71) ~[na:1.7.0_45]
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361) ~[na:1.7.0_45]
EN

回答 1

Stack Overflow用户

发布于 2014-05-27 14:38:24

在我的安装中,MaxPermSize的默认值是512 MB。我认为可能需要这么大的内存,特别是对于一些模板。

尝试将您的SBT_OPTS更改为包含-XX:MaxPermSize=512M

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/23880617

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档