gpt4 book ai didi

java - jruby Rails:Java::JavaLang::OutOfMemoryError:Java 堆空间

转载 作者:行者123 更新时间:2023-12-01 09:17:07 27 4
gpt4 key购买 nike

我正在尝试编译我的 javascript 资源。我已经包含了plotly.js 文件,大小几乎为2MB。我还包含了 angualr2.dev.js 文件,该文件的大小也是 1MB。

每当我使用命令 rake asset:precompile RAILS_ENV=product 编译我的 Assets 时,我都会遇到以下错误。

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)

我该如何解决这个问题?

最佳答案

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

...而不是gem 'therubyrhino'

关于java - jruby Rails:Java::JavaLang::OutOfMemoryError:Java 堆空间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40465589/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com