java.lang.OutOfMemoryError: Java heap space

Hello all, @ewpatton
I can't generate one extensions i have this error can some one help please? i have increase java memory to 4096 but nothing change
the folder appinventor\components\build\externalComponents is created but can't generate DEX and got this error the size of the extension is around 3,5Mb

dexAllExtensions:

dexExtension:
     [java]
     [java] UNEXPECTED TOP-LEVEL ERROR:
     [java] java.lang.OutOfMemoryError: Java heap space

What operation is consuming more space?

<!-- =====================================================================
       dexAllExtensions: create classes.dex for each extension.
       ===================================================================== -->
  <target name="dexAllExtensions" depends="jarAllExtensions">
    <foreach target="dexExtension" param="extension">
      <path>
        <fileset dir="${ExternalComponent-class.dir}" >
          <include name="*.jar"/>
        </fileset>
      </path>
    </foreach>
  </target>

  <target name="dexExtension" depends="">
    <basename property="extensionType" file="${extension}" suffix=".jar"/>
    <java jar="${lib.dir}/android/tools/dx.jar"
          fork="true"
          failonerror="true">
      <arg value="--dex"/>
      <arg value="--no-strict"/>
      <arg value="--output"/>
      <arg value="${ExternalComponent.dir}/${extensionType}/classes.jar"/>
      <arg value="${ExternalComponent-class.dir}/${extensionType}.jar"/>
    </java>
    <echo>Dexing extension: ${extensionType}</echo>
  </target>