Flex ant out of memory error.

在build.xml里面加入 :
<jvmarg value="-Xmx2048M" />
<jvmarg value="-Xms512M" />
就好了。
project basedir="." default="main" name="myapp"> 

        <taskdef resource="flexTasks.tasks" classpath="${basedir}/../library/ant/flexTasks.jar" /> 

        <property environment="env" /> 
        <property name="FLEX_HOME" value="${env.FLEX_HOME}" /> 
        <property name="src.dir" value="${basedir}/src" /> 
        <property name="output.dir" value="${basedir}/../public" /> 
        <property name="lib.dir" value="${basedir}/../library/flex" /> 

        <target name="main" depends="wrapper"> 
                <mxmlc file="${src.dir}/index.mxml" output="${output.dir}/index.swf" keep-generated-actionscript="false" incremental="true"> 
                        <jvmarg value="-Xmx2048M" /> 
                        <jvmarg value="-Xms512M" /> 
                        <locale>en_US</locale> 
                        <locale>fr_BE</locale> 
                        <source-path>src</source-path> 
                        <source-path>src/locale/{locale}</source-path> 
                        <allow-source-path-overlap>true</allow-source-path-overlap> 
                        <load-config filename="${FLEX_HOME}/frameworks/flex-config.xml" /> 
                        <source-path path-element="${FLEX_HOME}/frameworks" /> 
                        <services>src/services-config.xml</services> 
                        <license product="flexbuilder3" serial-number="XXXX-XXXX-XXXX-XXXX-XXXX-XXXX"/> 
                        <compiler.include-libraries dir="${lib.dir}" append="true"> 
                            <include name="flexlib.swc" /> 
                                <include name="datavisualization.swc"/> 
                                <include name="datavisualization_rb.swc"/> 
                        </compiler.include-libraries> 
                </mxmlc> 
        </target> 

        <target name="wrapper"> 
                <html-wrapper title="My Application" file="index.html" 
                        height="100%" width="100%" application="app" swf="index" version-major="9" version-minor="0" version-revision="0" history="true" 
                        template="client-side-detection" output="${output.dir}" /> 
        </target> 

        <target name="clean"> 
                <delete includeemptydirs="true"> 
                        <!-- Deletes playerProductInstall.swf --> 
                        <fileset dir="${output.dir}" includes="playerProductInstall.swf" defaultexcludes="false" /> 
                        <!-- Deletes history --> 
                        <fileset dir="${output.dir}/history" includes="**/*" /> 
                        <!-- Deletes index.html --> 
                        <fileset dir="${output.dir}" includes="index.html" defaultexcludes="false" /> 
                        <!-- Deletes and AC_OETags.js --> 
                        <fileset dir="${output.dir}" includes="AC_OETags.js" defaultexcludes="false" /> 
                        <!-- Deletes index.swf --> 
                        <fileset dir="${output.dir}" includes="index.swf" defaultexcludes="false" /> 
                </delete> 
        </target> 

</project>

你可能感兴趣的:(java,html,xml,ant,Flex)