3

How to increase Java Heap Memory for CMD 6.1.1.76 ?

I think these are no longer valid methods:

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

I'm getting a Java heap exception when running

sencha app build

specifically while slicing images (I don't want to skip this)

code4jhon
  • 5,725
  • 9
  • 40
  • 60

2 Answers2

6

You have to edit sencha.cfg file which is located in your Cmd folder. If you are on Windows - most probably here:

C:\Users\<user>\bin\Sencha\Cmd\6.1.1.76

In it, you will find the part with JVM startup arguments:

#------------------------------------------------------------------------------
# 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

You can find more info about configuration files in the Sencha Cmd Docs.

EDIT: From Cmd 6.5.0 this no longer works. You will have to use _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.
pagep
  • 3,488
  • 1
  • 26
  • 47
  • 2
    You don't have to (and should not) use _JAVA_OPTIONS, except as a prefix to running an individual command. As of 6.5.0, you can edit the `sencha.vmoptions` file in the Sencha Cmd install dir. Unfortunately, this can't be set on an app-by-app basis. – Robert Watkins Oct 22 '19 at 05:28
0

for new versions of sencha cmd (7.1+) see this image

you might need to increase Xms and Xmx more (please, don't exaggerate here)

For me, I have -Xms2048 -Xmx8192

close your bash/terminal and start it again over