2016-11-07 1 views
0

자바 애셋을 컴파일하려고합니다. 나는 거의 2MB 크기의 plotly.js 파일을 포함시켰다. 또한 나는 1MB 크기의 angualr2.dev.js 파일을 포함시켰다.jruby rails : Java :: JavaLang :: OutOfMemoryError : 자바 힙 공간

명령을 사용하여 자산을 컴파일 할 때마다 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

대신 내가 레이크 자산을 시도 gem 'therubyrhino'

+0

의 ... (예 : node가 설치 한)

대체 ExecJS 런타임을 사용하여 미리 컴파일 시도 : 사전 컴파일 EXECJS_RUNTIME = '노드'JRUBY_OPTS = "- J-D32 -XC "그리고 그것은 나를 위해 일했다 .. 감사합니다 –

관련 문제