2016-11-07 3 views
0

Ich versuche, meine Javascript-Assets zu kompilieren. Ich habe plotly.js Datei enthalten, die fast 2 MB groß ist. Ich habe auch Angualr2.dev.js Datei enthalten, die wiederum 1 MB groß ist.jruby rails: Java :: JavaLang :: OutOfMemoryError: Java-Heap-Raum

immer wenn ich meine Assets mit Befehl rake assets:precompile RAILS_ENV=production kompiliere ich bekomme unter Fehler.

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) 

Wie kann ich dieses Problem lösen?

Antwort

1

versuchen Pre-Kompilieren eines alternativen ExecJS Laufzeit (zB node installiert haben)

... statt gem 'therubyrhino'

+0

habe ich versucht Rake Vermögen: precompile EXECJS_RUNTIME = 'Knoten' JRUBY_OPTS = "- J-d32 -XC "und es hat für mich funktioniert ... danke –