如何为CMD 6.1.1.76增加Java堆内存?
我认为这些不再是有效的方法:
http://www.ladysign-apps.com/developer/java-heap-exception-when-using-sencha-cmd/#.VxQIauMrJTY
https://www.sencha.com/forum/showthread.php?251529-Java-Heap-Size
运行
时出现Java堆异常sencha app build
特别是切片图像时(我不想跳过这个)
答案 0 :(得分:3)
您必须编辑位于Cmd文件夹中的 sencha.cfg 文件。 如果你在Windows上 - 最有可能在这里:
C:\Users\<user>\bin\Sencha\Cmd\6.1.1.76
在其中,您将找到具有JVM启动参数的部分:
#------------------------------------------------------------------------------
# These are the JVM startup arguments. The primary things to tweak are the JVM
# heap sizes.
# java.awt.headless=true - required to make phantomjs (used by theme slicer)
# work in headless environments
# cmd.jvm.args=-Xrunjdwp:transport=dt_socket,server=y,address=8888,suspend=n -Xms128m -Xmx2048m -Djava.awt.headless=true
cmd.jvm.args=-Xms128m -Xmx1024m -Dapple.awt.UIElement=true
您可以在Sencha Cmd Docs中找到有关配置文件的更多信息。
编辑:从Cmd 6.5.0开始,这不再适用。您必须使用_JAVA_OPTIONS
# On previous versions, this file provided a way to specify the cmd.jvm.* properties
# to control the execution of the JVM. To accommodate all possible execution scenarios
# support for these properties has been removed in favor of using the _JAVA_OPTIONS
# environment variable.