首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >jruby : Java::JavaLang::OutOfMemoryError: Java堆空间

jruby : Java::JavaLang::OutOfMemoryError: Java堆空间
EN

Stack Overflow用户
提问于 2016-11-07 12:47:30
回答 1查看 167关注 0票数 0

我正在尝试编译我的javascript资产。我已经包含了plotly.js文件,它的大小几乎是2MB。此外,我还包括了angualr2.dev.js文件,它的大小同样是1MB。

每当我使用命令rake assets:precompile RAILS_ENV=production编译我的资产时,我就会出现以下错误。

代码语言:javascript
复制
Java::JavaLang::OutOfMemoryError: Java heap space
org.mozilla.javascript.NativeArray.<init>(org/mozilla/javascript/NativeArray.jav
a:66)
org.mozilla.javascript.Context.newArray(org/mozilla/javascript/Context.java:1626
)
org.mozilla.javascript.ScriptRuntime.newArrayLiteral(org/mozilla/javascript/Scri
ptRuntime.java:3733)
org.mozilla.javascript.Interpreter.interpretLoop(org/mozilla/javascript/Interpre
ter.java:1776)
org.mozilla.javascript.Interpreter.interpret(org/mozilla/javascript/Interpreter.
java:815)
org.mozilla.javascript.InterpretedFunction.call(org/mozilla/javascript/Interpret
edFunction.java:109)
org.mozilla.javascript.NativeArray.iterativeMethod(org/mozilla/javascript/Native
Array.java:1635)
org.mozilla.javascript.NativeArray.execIdCall(org/mozilla/javascript/NativeArray
.java:330)
org.mozilla.javascript.IdFunctionObject.call(org/mozilla/javascript/IdFunctionOb
ject.java:97)
org.mozilla.javascript.Interpreter.interpretLoop(org/mozilla/javascript/Interpre
ter.java:1479)
org.mozilla.javascript.Interpreter.interpret(org/mozilla/javascript/Interpreter.
java:815)
org.mozilla.javascript.InterpretedFunction.call(org/mozilla/javascript/Interpret
edFunction.java:109)
org.mozilla.javascript.NativeArray.iterativeMethod(org/mozilla/javascript/Native
Array.java:1635)
org.mozilla.javascript.NativeArray.execIdCall(org/mozilla/javascript/NativeArray
.java:330)
org.mozilla.javascript.IdFunctionObject.call(org/mozilla/javascript/IdFunctionOb
ject.java:97)
org.mozilla.javascript.Interpreter.interpretLoop(org/mozilla/javascript/Interpre
ter.java:1479)
org.mozilla.javascript.Interpreter.interpret(org/mozilla/javascript/Interpreter.
java:815)
org.mozilla.javascript.InterpretedFunction.call(org/mozilla/javascript/Interpret
edFunction.java:109)
org.mozilla.javascript.NativeArray.iterativeMethod(org/mozilla/javascript/Native
Array.java:1635)
org.mozilla.javascript.NativeArray.execIdCall(org/mozilla/javascript/NativeArray
.java:330)
org.mozilla.javascript.IdFunctionObject.call(org/mozilla/javascript/IdFunctionOb
ject.java:97)
org.mozilla.javascript.Interpreter.interpretLoop(org/mozilla/javascript/Interpre
ter.java:1479)
org.mozilla.javascript.Interpreter.interpret(org/mozilla/javascript/Interpreter.
java:815)
org.mozilla.javascript.InterpretedFunction.call(org/mozilla/javascript/Interpret
edFunction.java:109)
org.mozilla.javascript.NativeArray.iterativeMethod(org/mozilla/javascript/Native
Array.java:1635)
org.mozilla.javascript.NativeArray.execIdCall(org/mozilla/javascript/NativeArray
.java:330)
org.mozilla.javascript.IdFunctionObject.call(org/mozilla/javascript/IdFunctionOb
ject.java:97)
org.mozilla.javascript.Interpreter.interpretLoop(org/mozilla/javascript/Interpre
ter.java:1479)
org.mozilla.javascript.Interpreter.interpret(org/mozilla/javascript/Interpreter.
java:815)
org.mozilla.javascript.InterpretedFunction.call(org/mozilla/javascript/Interpret
edFunction.java:109)
org.mozilla.javascript.NativeArray.iterativeMethod(org/mozilla/javascript/Native
Array.java:1635)
org.mozilla.javascript.NativeArray.execIdCall(org/mozilla/javascript/NativeArray
.java:330)
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)

我怎样才能解决这个问题?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-11-07 12:55:51

尝试使用备用ExecJS运行时进行预编译(例如安装了node )。

..。而不是gem 'therubyrhino'

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

https://stackoverflow.com/questions/40465589

复制
相关文章

相似问题

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