This content has been marked as final.
Show 1 reply
-
1. Re: Memory leak with @Out in SLSB
wangliyu May 27, 2010 3:33 PM (in response to wangliyu)Found 2 ways work around this problem:
1> don't declare any @Out in the SLSB, use ScopeType.CONVERSATION.getContext().set("variable", variable); since the veriable is declared within the method, it will release the reference when returning from the method, this will avoid problem and performance is better than @Out.
2> Add @In(required=false) before the @Out, the @In just tell Seam, release this attribute reference after the method returns, this will register the same attributes into both Inject and Outject attribute list, performance is worse than previous one.
Actually in the component.disinject method, it should check if the target component is a STATELESS Bean, if it is, it should release the reference of @Out attribute list.
I'll add this to the gotcha list