Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

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

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.