Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] AspectJ and memory management

Matthew Webster wrote:
Noone knows anything about this, or is it really impossible to do?

Is noone using AspectJ with enormous object graphs? If yes, then how do
you handle it?

As Wes says it seems you simply want lazy instantiation of X rather than
lazy definition of X or interface Y (which isn't supported by Java unless
you use Hot Code Replace). I presume you are concerned about footprint.

Right, that's what I'm after.

Using lazy instantiation you only incur the additional cost of the
reference to X in each class that implements the interface. The cost of
implementing the interface is fixed i.e. not dependent on the number of
instances. The lifetime of X is tied to that of A and will be garbage
collected at the same time.

Right. Which is not what I'm after, I need separate lifetime of A and X, or else there's no way to do memory management.

Anyway, Wes and I resolved the terminology issues off-list and it appears what I want to do can't be done in AspectJ.

/Rickard



Back to the top