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:
C:Users\[your-name]\bin\Sencha\Cmd\[your-current-cmd-version]\sencha.cfg
(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 -

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

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

Comments

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

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

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

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

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

Post a Comment

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