How to increase java heap size for flex compiler?

Sergey Bartoshik's Avatar

Sergey Bartoshik

29 Sep, 2011 01:50 PM

How to increase java heap size for flex compiler?

  1. Support Staff 1 Posted by Yennick Trevels on 29 Sep, 2011 02:07 PM

    Yennick Trevels's Avatar
  2. 2 Posted by Sergey Bartoshi... on 30 Sep, 2011 11:52 AM

    Sergey Bartoshik's Avatar

    Unfortunately this doesn't not help.
    The plugin create that command

    15:43:16.798 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Execute:Java13CommandLauncher: Executing 'C:\Program Files (x86)\Java\jdk1.6.0_17\jre\bin\java.exe' with arguments:
    '-jar' 'c:\flexSdk\lib\compc.jar' '-source-path+=D:\MyDoc\Dropbox\source\java\IDEA\flex-gradle5\mircore\src' '-include-sources+=D:\MyDoc\Dropbox\source\java\IDEA\flex-gradle5\mircore\src' '-library-path+=D:\MyDoc\Dropbox\source\java\IDEA\flex-gradle5\mircore\libs\Mate 0.9.1.swc' '-library-path+=D:\MyDoc\Dropbox\source\java\IDEA\flex-gradle5\mircore\libs\SilinLib.swc' '-compiler.namespaces.namespace+=http://ns.mirapolis.org/flex/mircore,d:\MyDoc\Dropbox\source\java\I...' '-include-namespaces+=http://ns.mirapolis.org/flex/mircore' '-output=D:\MyDoc\Dropbox\source\java\IDEA\flex-gradle5\mircore\build/mircore.swc'

    If I add -Xmx1024m -Xms512m after "C:\Program Files (x86)\Java\jdk1.6.0_17\jre\bin\java.exe"
    then all work correct.

    I changed sources of the plugin and add

    myArgs = '-Xmx1024m -Xms512m'

        ant.java(args: myArgs,
                jar: project.flexHome + '/lib/compc.jar',
                dir: project.flexHome + '/frameworks',
                fork: true,
                resultproperty: ANT_RESULT_PROPERTY,
                outputproperty: ANT_OUTPUT_PROPERTY) {
    
            compilerArguments.each { compilerArgument ->
                arg(value: compilerArgument)
            }
        }
    

    but it doesn't work again becouse arguments insert after '-jar'
    'c:\flexSdk\lib\compc.jar'

    So I don't know what to do. I don't have much experience with dradle and groovy.

  3. Support Staff 3 Posted by Yennick Trevels on 30 Sep, 2011 12:20 PM

    Yennick Trevels's Avatar

    Can you try to add maxmemory="256m" to the ant.java task, like this:
    ant.java(args: myArgs,
                jar: project.flexHome + '/lib/compc.jar',
                dir: project.flexHome + '/frameworks',
                fork: true,
                maxmemory="256m",
                resultproperty: ANT_RESULT_PROPERTY,
                outputproperty: ANT_OUTPUT_PROPERTY) {

    Do this for the AbstractMxmlc.groovy and the Compc.groovy classes.

    I'll try to add this to GradleFx so that users will be able to configure this, but this will probably be in about 2 weeks since I'm quite busy right now. I'll log a feature request for it in our bugtracking system on GitHub.

  4. 4 Posted by Sergey Bartoshi... on 30 Sep, 2011 12:43 PM

    Sergey Bartoshik's Avatar

    I didn't try you advice I think it works.

    I've added jvmargs

    myArgs = '-Xmx1024m -Xms512m'

        ant.java(jvmargs: myArgs,
                jar: project.flexHome + '/lib/compc.jar',
                dir: project.flexHome + '/frameworks',
                fork: true,
                resultproperty: ANT_RESULT_PROPERTY,
                outputproperty: ANT_OUTPUT_PROPERTY) {
    
            compilerArguments.each { compilerArgument ->
                arg(value: compilerArgument)
            }
        }
    

    So it works correctly. Thanks for you help!!

  5. Support Staff 5 Posted by Yennick Trevels on 30 Sep, 2011 12:47 PM

    Yennick Trevels's Avatar

    awesome! I'll integrate this into GradleFx.

  6. Yennick Trevels closed this discussion on 30 Sep, 2011 12:47 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac