Java Heap Exception when using Sencha Cmd

Posted on in Cmd Environment

Are you running Sencha Cmd (typically on Windows), and you run into a Java Heap Space error, like the one below?

[ERROR] com.sencha.exceptions.BasicException: java heap space

The problem is that your JVM is running out of memory. Luckily you can control this great site.
Open the sencha.cfg file, in your Sencha Cmd installation folder.
For example:
(for Mac OSX, you can find this file: [user-home]/bin/Sencha/Cmd/[your-current-cmd-version]/sencha.cfg)

Search in this file for: cmd.jvm.args
Here you can change the minimum heap space (xms) and the maximum heap space (xmx).
The xmx, is what you need to higher up. For example:

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

cmd.jvm.args=-Xms128m -Xmx2048m -Dapple.awt.UIElement=true

Now restart your terminal, and try the sencha command again. This should work.


  1. Alex says on
    July 15, 2015 at 11:12 am

    Small update:
    at least in latest cmd versions it should be bin/Sencha/Cmd/

  2. Peter Rietveld says on
    October 16, 2015 at 8:30 pm

    Thanks for sharing this with us. I couldn’t figure it out why it wasn’t working. Your solution just works fine.

    Maybe consider to update this great post to be just more great 😉

  3. Keith says on
    September 13, 2017 at 10:18 pm

    Starting with sencha commadn 6.5.1, it no longer creates the .sencha folder containing the various config items. In order to specify the jvm arguments, you must set the _JAVA_OPTIONS environment variable to something like -Xms128m -Xmx2048m

Post a Comment

Your email is never published nor shared.
Required fields are marked *