2016-11-07 46 views
0

我想编译我的JavaScript资产。我已经包含了几乎2MB大小的plotly.js文件。还包括了angualr2.dev.js文件,它的大小再次为1MB。jruby rails:Java :: JavaLang :: OutOfMemoryError:Java堆空间

每当我使用命令编译我的资产rake assets:precompile RAILS_ENV=production我越来越低于错误。

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) 

我该如何解决这个问题?

回答

1

尝试使用备用ExecJS运行时(例如,具有安装node

预编译代替gem 'therubyrhino'

+0

我试图耙资产...:预编译EXECJS_RUNTIME = '节点' JRUBY_OPTS =“ - J-D32 -XC“,它为我工作..谢谢 –

相关问题