airsdk / Adobe-Runtime-Support

Report, track and discuss issues in Adobe AIR. Monitored by Adobe - and HARMAN - and maintained by the AIR community.
200 stars 11 forks source link

java.lang.OutOfMemoryError: Java heap space on MXMLC #2899

Open shaymolho opened 10 months ago

shaymolho commented 10 months ago

Using latest air (50.2.3.7) I get OutOfMemory on mxmlc

Caused by: java.lang.OutOfMemoryError: Java heap space
    at java.util.Arrays.copyOf (Unknown Source)
    at java.io.ByteArrayOutputStream.grow (Unknown Source)
    at java.io.ByteArrayOutputStream.ensureCapacity (Unknown Source)
    at java.io.ByteArrayOutputStream.write (Unknown Source)
    at com.adobe.flash.swf.io.OutputBitStream.write (OutputBitStream.java:173)
    at com.adobe.flash.swf.io.SWFWriter.finishTag (SWFWriter.java:408)
    at com.adobe.flash.swf.io.SWFWriter.writeTag (SWFWriter.java:1518)
    at com.adobe.flash.swf.io.SWFWriter.writeTag (SWFWriter.java:1291)
    at com.adobe.flash.swf.io.SWFWriter.writeFrames (SWFWriter.java:875)
    at com.adobe.flash.swf.io.SWFWriter.writeTo (SWFWriter.java:2656)
    at com.adobe.flash.swc.io.SWCWriter.writeLibrary (SWCWriter.java:111)
    at com.adobe.flash.swc.io.SWCWriterBase.write (SWCWriterBase.java:102)
    at com.adobe.flash.swc.io.SWCWriter.write (SWCWriter.java:46)
    at com.adobe.flash.compiler.clients.COMPC.buildArtifact (COMPC.java:175)
    at com.adobe.flash.compiler.clients.MXMLC.compile (MXMLC.java:559)
    at com.adobe.flash.compiler.clients.MXMLC.mainNoExit (MXMLC.java:242)
    at com.adobe.flash.compiler.clients.MXMLC.mainNoExit (MXMLC.java:196)
    at com.adobe.flash.compiler.clients.COMPC.staticMainNoExit (COMPC.java:75)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (Unknown Source)
    at java.lang.reflect.Method.invoke (Unknown Source)
    at com.adobe.flash.compiler.ant.FlexTask.executeInProcess (FlexTask.java:309)
    at com.adobe.flash.compiler.ant.FlexTask.execute (FlexTask.java:260)
    at org.apache.tools.ant.UnknownElement.execute (UnknownElement.java:291)
    at sun.reflect.GeneratedMethodAccessor32.invoke (Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (Unknown Source)
    at java.lang.reflect.Method.invoke (Unknown Source)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute (DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform (Task.java:348)
    at org.apache.tools.ant.Target.execute (Target.java:390)
    at org.apache.tools.ant.Target.performTasks (Target.java:411)
[ERROR] 

windows, java 17 trying to package ipa i don't have adt.log because it's before adt command my mxmlc.bat:

@echo off

rem
rem  ADOBE CONFIDENTIAL
rem
rem  Copyright 2004-2012 Adobe Systems Incorporated
rem  All Rights Reserved.
rem
rem  NOTICE: All information contained herein is, and remains
rem  the property of Adobe Systems Incorporated and its suppliers,
rem  if any. The intellectual and technical concepts contained
rem  herein are proprietary to Adobe Systems Incorporated and its
rem  suppliers and are protected by trade secret or copyright law.
rem  Dissemination of this information or reproduction of this material
rem  is strictly forbidden unless prior written permission is obtained
rem  from Adobe Systems Incorporated.
rem

rem
rem mxmlc.bat script to launch mxmlc-cli.jar in Windows Command Prompt.
rem On OSX, Unix, or Cygwin, use the mxmlc shell script instead.
rem

setlocal

if "x%AIR_SDK_HOME%"=="x"  (set AIR_SDK_HOME=%~dp0..) else echo Using AIR SDK: %AIR_SDK_HOME%

@java -Dsun.io.useCanonCaches=false -Xms4048m -Xmx4048m -Dflexlib="%AIR_SDK_HOME%\frameworks" -jar "%AIR_SDK_HOME%\lib\mxmlc-cli.jar" %*
ajwfrost commented 10 months ago

My first suggestion was going to be to increase the heap size available but you've already done that in the batch file! Can I check whether you have any "embed" tags that are pulling in very large files? Otherwise I would have though 4GB should be sufficient!