Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Memory consumption problems

Hi Tim,

Yes, the inclusions/exclusions define what gets pulled into the world
map for weaving, but they (and related weaver state for them) do still
consume a bunch of space.  Any types pulled in during analysis of the
types for weaving is temporarily in the world but discarded later (or
rather orphaned later, for GC).  Things are improved in AspectJ 1.6.7.
 In 1.6.7, after a weave we more aggressively chuck away (orphan)
types that were not affected by ITDs.  Basically trying to discard
anything which can easily/cheaply be discovered again later.  If the
world is still too large then having a hook so we can be told we are
no longer needed (a shutdown type call) may be the 'final solution'.

More details on the strategy that is now turned on by default are in
this article:
http://andrewclement.blogspot.com/2009/04/aspectj-load-time-weaving-and-memory.html
In the article it is called type demotion and had to be switched on
prior to 1.6.7, but in 1.6.7 it is the default behaviour.

cheers,
Andy

2009/12/2 Tim Schraepen <sch3lp@xxxxxxxxx>:
>
> Why don't you just use the inclusion and exclusion rules in the aop.xml files
> to decide which classes actually get loaded into the World map?
>
>
> Andy Clement wrote:
>>
>> Given that doing the right thing with freeing memory is non trivial, I was
>> thinking just now about an interim measure.  A user callable API where you
>> could indicate to the AspectJ infrastructure that you *knew* the
>> classloader
>> had finished loading everything you wanted it to.  Upon making the API
>> call
>> we would immediately discard the whole weaver *but* keep a note of the
>> classloader so that any future attempts to load classes that would have
>> been
>> woven will receive suitable warning/error messages.  I'll take any
>> comments
>> anyone has on doing something like that... I'm not sure how easy it is for
>> you to determine when you know everything has been loaded..
>>
>> Cheers
>>
>
> --
> View this message in context: http://old.nabble.com/Memory-consumption-problems-tp18649090p26607167.html
> Sent from the AspectJ - users mailing list archive at Nabble.com.
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>


Back to the top