View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3820458#3820458

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3820458

I would say that this is because the MethodInvocations aren't hard referenced

for very long. The GC can easily dispose of short lived references.



If you try to pool them, you are making more work for the GC because the objects

need to be continually checked.



The latest GCs do object pooling anyway for frequently used object types.

Let the JIT decide what objects need to be pooled.

It can will do a better job anyway - you can make mistakes by not reinitialising 
objects

correctly.



FYI: I recently got rid of the object pooling in jbossmq. Not only was it

unnecessary, it made the implementation more brittle. 

The message cache had to be very careful about when and what message

object it was reusing. Very error prone for any developers who weren't aware of the

pooling semantics.



Like the poster said above, you only need pool when there are significant resources

like threads or jdbc connections that make constructing the object slow.



Regards,

Adrian


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to