The AspectJ compiler aborts with an OutOfMemoryError when compiling many classes. How can I fix this?

0
Posted

The AspectJ compiler aborts with an OutOfMemoryError when compiling many classes. How can I fix this?

0

ajc can use more memory than a javac compile of the corresponding pure-java sources when aspects are added to the mix. You’ll need to increase the memory available. The command ajc is actually a script that launches a Java virtual machine with the correct classpath. You should make a copy of this script, rename it, and then edit it. Change the -Xmx option, size of memory allocation pool (heap). You might try -Xmx128M or even -Xmx256M. When running under Ant, give Ant more memory or use the fork option together with the Xmaxmem option. When running under an IDE, look to the documentation for the IDE to determine how to increase available memory.

0

ajc can use more memory than a javac compile of the corresponding pure-java sources when aspects are added to the mix. You’ll need to increase the memory available. The command ajc is actually a script that launches a Java virtual machine with the correct classpath. You should make a copy of this script, rename it, and then edit it. Change the -Xmx option, size of memory allocation pool (heap). You might try -Xmx128M or even -Xmx256M. When running under Ant, give Ant more memory or use the fork option together with the Xmaxmem option. When running under an IDE, look to the documentation for the IDE to determine how to increase available memory. In either case, doing incremental compilations can hold on to more memory than a one-shot compile process, as the compiler trades space for time in recompiles.

Related Questions