播放2.3.6 Java-带sbt-uglify的OutOfMemory错误 [英] Play 2.3.6 Java - OutOfMemory errors w/ sbt-uglify

查看:97
本文介绍了播放2.3.6 Java-带sbt-uglify的OutOfMemory错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试使用sbt-uglify插件时出现问题.我已经根据以下项目配置了该项目: https://github.com/sbt/sbt-uglify

I'm having an issue when trying to use the sbt-uglify plugin. I've configured the project per: https://github.com/sbt/sbt-uglify

在plugins.sbt中:

in plugins.sbt:

addSbtPlugin("com.typesafe.sbt" % "sbt-uglify" % "1.0.3")

在build.sbt中:

in build.sbt:

pipelineStages := Seq(uglify, digest, gzip)

我有不少的JS文件(超过60个).我得到的是一个OutOfMemory异常,它使我无法完成dist命令.

I have a non-trivial number of JS files (60+). What I've been getting is an OutOfMemory exception which prevents me from being able to complete a dist command.

还有其他人遇到过此问题吗?任何想法/解决方案都表示赞赏.

Has anyone else encountered this problem? Any ideas/solutions are appreciated.

(注意:我已经尝试提高SBT_OPTS的效果,但尚未成功).

(NOTE: I've tried bumping up my SBT_OPTS without success already).

谢谢!

推荐答案

我想您确实内存不足.我不知道该插件是否在使用它,但是您可以限制Java要求的内存.

I suppose you really are running out of memory. I don't know whether or not the plugin is cuasing it, but you can limit the memory Java asks for.

您是否尝试为Java设置XmxXms选项?

Have you tried setting the Xmx or Xms options for Java?

如果知道计算机的内存限制,则可以轻松设置这些选项.假设您有1GB的可用内存,我们将暂时使用_JAVA_OPTIONS将Java的最大堆大小设置为512MB,这是由Play Framework提取的:

If you know your memory limit on your machine, you can easily set those options. Let's just say you have 1GB of memory available, we'll set the max heap size for Java to 512MB, temporarily using _JAVA_OPTIONS, which is picked up by Play Framework:

export _JAVA_OPTIONS="-Xms256m -Xmx512m"

然后,您可以尝试运行dist命令.应该立即打印出拾取了Java选项.

Then you can try running the dist command. It should immediately print out that the Java Options were picked up.

这篇关于播放2.3.6 Java-带sbt-uglify的OutOfMemory错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆