The other thing that helps a lot in my project builds is to use fork='true' when starting the compile tasks (<javac>, <mxmlc>, <compc>) from ant. It will incur the overhead of new JVM child processes, but with the benefit of reclaiming ALL of the memory used for the compile. In this model, memory gets reclaimed because of the compile process exiting, instead of waiting for the Java GC in the parent ant process to do it.
tlj -----Original Message----- From: simon gladman [mailto:[email protected]] Sent: Monday, July 08, 2013 12:35 PM To: [email protected] Subject: Re: Weird Issues With Flex Project Thanks Timothy, I'm back to: -Xms512m -Xmx1024m -XX:MaxPermSize=512m -XX:PermSize=256m The monitor shows that the heap size grows with each compile and when it reaches approx 1GB (with used around 430MB), Flash Builder crashes. Other projects in the same workspace including ones with more worker SWF's and more code never exceed 588,906,496 B of heap. Something about my swarm chemistry project is getting the heap to 1,073,741,824 B. Maybe it's the 'chemistry' part! simon On 8 July 2013 16:53, Timothy Jones <[email protected]> wrote: > You definitely wouldn't need the -Xms1024m (stack size). In fact, > that one might be hurting you. > > You can run JVisualVM to monitor the usage of the different areas of > JVM memory. That's takes the guesswork out of the picture. > I would also put MaxPermSize to be larger than PermSize (and actually, > you can take that one down). > HTH. > > > tlj > > -----Original Message----- > From: simon gladman [mailto:[email protected]] > Sent: Monday, July 08, 2013 11:12 AM > To: [email protected] > Subject: Re: Weird Issues With Flex Project > > I've tried all sorts. Currently using: > > *-Xms1024m* > *-Xmx2048m* > *-XX:MaxPermSize=512m* > *-XX:PermSize=512m* > > Simon > > > On 8 July 2013 16:01, Alex Harui <[email protected]> wrote: > > > Have you tried increasing available heap? > > > > http://stackoverflow.com/questions/14143753/java-heap-error-in-flash > > -b > > uilde > > r-4-6 > > > > On 7/8/13 7:46 AM, "simon gladman" <[email protected]> wrote: > > > > >Thanks Alex, > > > > > >Flash Builder 4.7 (latest version - I uninstalled and reinstalled > > >earlier), the SDK is 4.9.1 (1447119). The logs says... > > > > > >*!ENTRY org.eclipse.core.jobs 4 2 2013-07-08 14:33:36.889* > > >*!MESSAGE An internal error occurred during: "Building workspace".* > > >*!STACK 0* > > >*java.lang.OutOfMemoryError: Java heap space* > > >* at java.util.Arrays.copyOf(Arrays.java:2786)* > > >* at > > >java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:71)* > > >* at > > >flash.swf.RandomAccessBuffer.write(RandomAccessBuffer.java:101)* > > >* at flash.swf.SwfEncoder.writeUI16(SwfEncoder.java:71)* > > >* at flash.swf.TagEncoder.encodeTagHeader(TagEncoder.java:311)* > > >* at flash.swf.TagEncoder.defineBinaryData(TagEncoder.java:330)* > > >* at > > >flash.swf.tags.DefineBinaryData.visit(DefineBinaryData.java:37)* > > >* at flash.swf.MovieEncoder.define(MovieEncoder.java:231)* > > >* at flash.swf.MovieEncoder.export(MovieEncoder.java:139)* > > >* at > > >flex2.compiler.PersistenceStore.writeAssets(PersistenceStore.java:9 > > >22 > > >)* > > >* at > > >flex2.compiler.PersistenceStore.writeCompilationUnit(PersistenceSto > > >re > > >.java > > >:875) > > >* > > >* at > > >flex2.compiler.PersistenceStore.writeCompilationUnits(PersistenceSt > > >or > > >e.jav > > >a:662) > > >* > > >* at > > >flex2.compiler.PersistenceStore.write(PersistenceStore.java:310)* > > >* at > > >flex2.compiler.CompilerAPI.persistCompilationUnits(CompilerAPI.java > > >:4 > > >766)* > > >* at > > >flex2.compiler.CompilerAPI.persistCompilationUnits(CompilerAPI.java > > >:4 > > >741)* > > >* at flex2.tools.oem.internal.OEMUtil.save(OEMUtil.java:180)* > > >* at flex2.tools.oem.Application.save(Application.java:619)* > > >* at > > >com.adobe.flexbuilder.multisdk.compiler.internal.ASBuilder.saveStat > > >e( > > >ASBui > > >lder.java:870) > > >* > > >* at > > >com.adobe.flexbuilder.multisdk.compiler.internal.ASItemBuilder.save > > >St > > >ate(A > > >SItemBuilder.java:119) > > >* > > >* at > > >com.adobe.flexbuilder.project.compiler.BuilderManager.maybeRemoveOl > > >de > > >stBui > > >lder(BuilderManager.java:171) > > >* > > >* at > > >com.adobe.flexbuilder.project.compiler.BuilderManager.getBuilder(Bu > > >il > > >derMa > > >nager.java:199) > > >* > > >* at > > >com.adobe.flexbuilder.project.compiler.internal.FlexIncrementalBuil > > >de > > >r.pre > > >Build(FlexIncrementalBuilder.java:464) > > >* > > >* at > > >com.adobe.flexbuilder.project.compiler.internal.FlexProjectBuilder. > > >bu > > >ildIt > > >em(FlexProjectBuilder.java:705) > > >* > > >* at > > >com.adobe.flexbuilder.project.compiler.internal.FlexProjectBuilder. > > >bu > > >ildWo > > >rkers(FlexProjectBuilder.java:592) > > >* > > >* at > > >com.adobe.flexbuilder.project.compiler.internal.FlexProjectBuilder. > > >bu > > >ild(F > > >lexProjectBuilder.java:406) > > >* > > >* at > > >com.adobe.flexbuilder.project.compiler.internal.FlexIncrementalBuil > > >de > > >r.bui > > >ld(FlexIncrementalBuilder.java:171) > > >* > > >* at > > >org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.ja > > >va > > >:728) > > >* > > >* at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)* > > >* at > > >org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManag > > >er > > >.java > > >:199) > > >* > > >* at > > >org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManag > > >er > > >.java > > >:239) > > >* > > >* at > > >org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.ja > > >va > > >:292) > > >* > > >* at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)* > > > > > >Simon > > > > > > > > >On 8 July 2013 15:30, Alex Harui <[email protected]> wrote: > > > > > >> Which exact versions of FlashBuilder and Apache Flex? > > >> > > >> What does the FlashBuilder log have to say? > > >> > > >> -Alex > > >> > > >> On 7/8/13 6:51 AM, "simon gladman" <[email protected]> wrote: > > >> > > >> >Hi All, > > >> > > > >> >I have a project which is making FlashBuilder with the latest > > >> >Apache Flex behave very oddly. > > >> > > > >> >The attached project is actually a rebuilt version of a previous one. > > >>When > > >> >I first started coding, it was fine, then suddenly I start > > >> >getting > > >>*Java > > >> >heap space* errors and FB stops working. Interestingly, the > > >> >first FXP export is only 3.8MB but after the heap space errors, > > >> >the FXP export > > >>jumps > > >> >up to 135MB (!). > > >> > > > >> >I've done loads of stuff with workers without any problems. I > > >> >can't see what's different about this. > > >> > > > >> >Any suggestions appreciated. The smaller FXP is here: > > >> >www.flexmonkey.co.uk/x_SwarmChemistry2.fxp > > >> > > > >> > > > >> >Thanks, > > >> > > > >> >Simon > > >> > > > >> >-- > > >> >*flexmonkey.co.uk | @FlexMonkey <https://twitter.com/FlexMonkey> > > >> >| > > >> >+44 > > >> (0) > > >> >7973 669691* > > >> > > >> > > > > > > > > >-- > > >*flexmonkey.co.uk | @FlexMonkey <https://twitter.com/FlexMonkey> | > > >+44 > > (0) > > >7973 669691* > > > > > > > -- > *flexmonkey.co.uk | @FlexMonkey <https://twitter.com/FlexMonkey> | +44 > (0) > 7973 669691* > -- *flexmonkey.co.uk | @FlexMonkey <https://twitter.com/FlexMonkey> | +44 (0) 7973 669691*
