I recently came across this issue while using Apache ANT to compile my Flex projects. The error is shown below :

[mxmlc] Error: PermGen space
[mxmlc] java.lang.OutOfMemoryError: PermGen space

Naturally the error is much longer than that but those two messages should be sufficient for this blog post. The issue faced here would be that the JVM probably had too much to handle and threw this error. The way around this would be to allocate more memory for ANT so this issue would not happen anymore. This can be accomplished (at least in Windows, never did this on Linux or Mac OS X) by adding an environment variable. Setting your environment variable as seen below should solve this issue, it worked for me 🙂

Variable Name : ANT_OPTS
Variable Value : -Xms512m -Xmx786m -XX:MaxPermSize=786m

I had to run my ANT build using command line because this only applies to the ANT install I got from the Apache website. I have not quite figured out how to do this directly on eclipse yet as putting in the PermSize VM argument into the eclipse.ini file does not seem to work. Will post the solution for Eclipse 3.4.2 when I get one.