Results 1 to 2 of 2

Thread: Passing java memory settings in gradle build to Cmd

  1. #1

    Join Date
    Sep 2010
    Location
    Nashville, TN
    Posts
    58

    Default Passing java memory settings in gradle build to Cmd

    We are migrating from an ant based build to gradle. Our cmd build uses a lot of memory, which we have handled previously by configuring the ANT_OPTS as shown below in bash_profile.

    export ANT_OPTS="-Xms128m -Xmx8192m"

    When the equivalent Sencha Cmd targets are run via gradle, those memory settings do not appear to be honored/passed when gradle calls Cmd. And the following error occurs:

    [INF] Compressing data with YuiJavascriptCompressor
    [ERR]
    [ERR] BUILD FAILED
    [ERR] com.sencha.exceptions.ExBuild: Failed to compress input
    [ERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorIm
    [ERR] pl.java:43)
    Running in debug gives us the additional information: Caused by: java.lang.OutOfMemoryError: Java heap space

    We have tried a number of different ways to set the proper memory allocation, but none appear to be picked up by cmd. One that should work (IMO) is shown below:

    Code:
    task ext6ProdReportApp(type: Exec) {
        group 'UI'
        description 'Build Production Report App'
        workingDir 'webroot/ext/workspace/reportApp'
        environment JAVA_OPTS: "-Xms128m -Xmx8192m"
        if(windows) {
            commandLine  'cmd', '/c', senchaPath + '\\sencha.exe', 'app', 'build', senchaTheme, 'production'
        } else {
            commandLine  senchaPath + '/sencha', 'app', 'build', senchaTheme, 'production'
        }
        inputs.files(senchaFiles)
        outputs.dir('webroot/ext/workspace/build/production/reportApp')
    }
    Has anyone been able to address memory allocation settings getting passed from gradle to cmd? Any thoughts would be appreciated. Cmd 6.2.0.103, Ext 6.0.2.437

    Note: setting -Xmx in sencha.vmoptions is picked up, however is not an optimal way to handle multiple build machines, developer machines, etc.

  2. #2

    Join Date
    Sep 2010
    Location
    Nashville, TN
    Posts
    58

    Default

    commandLine senchaPath + '/sencha', '-J-Xmx8192m', 'app', 'build', senchaTheme, 'production'

    This is working on OSX/Linux, trying to find the magic config for Windows (-J is not accepted).

Similar Threads

  1. Cant build sencha-phonegap app for android (cordova.gradle does not exist)
    By joseandresromero in forum Sencha Touch 2.x: Q&A
    Replies: 1
    Last Post: 14 Sep 2015, 10:55 AM
  2. Passing java Pojo from Extjs to Spring Controller
    By dev_java in forum Ext 3.x: Help & Discussion
    Replies: 6
    Last Post: 4 Aug 2014, 4:57 AM
  3. Passing data from Java Controller to ExtJs
    By maylwy in forum Ext: Q&A
    Replies: 1
    Last Post: 16 May 2014, 3:52 PM
  4. [OPEN] [Serious] Settings itemHeight to 0 in list causing Tab to hang and leak memory
    By riahut.com in forum Sencha Touch 2.x: Bugs
    Replies: 2
    Last Post: 8 Jan 2013, 9:16 AM
  5. passing data from java class to ExtJs' treepanel
    By pirusira in forum Ext 3.x: Help & Discussion
    Replies: 10
    Last Post: 24 Jun 2010, 1:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •