[Pogamut-list] Full memory
jakub.gemrot
pogamut-forum at artemis.ms.mff.cuni.cz
Wed Apr 15 16:56:23 CEST 2009
Re: Full memory
Author: jakub.gemrot
Hi!
Are you using anonymous classes as listeners? Do you use them to hook agents to something outside the agent?
If so - it may be your problem... every anonymous class instance contains a strong reference to the instance
that encloses it. If you register such listener somewhere else in the code (then it mean there are the strong
reference from outside of the agent to your listener that has the strong reference to the agent) it
will make instance of the agent strongly reachable even after you drop the reference to the agent (mind the listener ;-))
In such cases you have to drop listeners inside shutdownAgent() method (or something like that :))
Cheers!
Jakub
More information about the Pogamut-list
mailing list