Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] iajc ant task - out of memory

Hi Lachlan,

> However, as our project has grown, we sometimes run into out of
> memory problems at compile time with the iajc task. Naturally we have
> tried playing with all the possible memory settings, and typically
> our developers now use 1024M as the maxmem setting. Usually
> everything works fine, but when the dreaded iajc memory error hits, a
> developer can be stuck for hours trying to remedy it. It happens with
> various JVMs (all Java5) - and on both Windows and Linux. The error
> is inconsistent. It is possible to compile twice in a row, making no
> changes, and have it fail the first time and work the second time.
> Sometimes deleting the classes to force a clean build will fix the
> problem. I know this is a FAQ item, and I am not really looking for
> answers on how to tweak the JVM settings.

When AspectJ moved to a pipeline compilation model, that addressed an
awful lot of memory problems that users had - but I know we still have
issues.  However, they tend to be with using AJDT (as more info is
held in memory to provide the nice UI feedback on what advises what)
or load-time weaving (since a proliferation of classloaders, which
seems common in app servers, can use up all your memory).  We only
have one open issue relating to running out of memory using iajc and
that is permgen memory rather than regular memory (see
https://bugs.eclipse.org/bugs/show_bug.cgi?id=161137).  Are you
running out of permgen?  If not, then perhaps you should raise a
bugzilla issue and we can investigate your problem.

I recently helped someone having issues in AJDT with a system
containing 7500 source files (~10000 classes) get going with iajc.  Is
your project much larger than that?  I presume you are just doing
straight compiles rather than using iajc in its incremental
compilation mode?  Are you building entirely from source, or are you
building source then using iajc as a binary weaving step in the build?
 Are you able to break the weaving into multiple separate iajc calls
that apply the aspects to a subset of your code each time?

At the moment I am working on migrating AspectJ to a Java6 level
compiler and also on shrinking down the data structures used in the
back end weaving process.  If you are amenable to it, I can supply dev
builds to see if the way we are heading will help alleviate some of
your problems in the short term which will then be followed by some
more fundamental changes in the longer term.  I need to optimize the
backend further for load-time weaving in the 1.6.0 timeframe and I
think some of these changes will also benefit (post)compile time
weaving.

Andy.


Back to the top