> From: Konstantin Kolinko [mailto:knst.koli...@gmail.com] > Subject: Re: [GUMP@vmgump]: Project tomcat-trunk-test-bio (in module > tomcat-trunk) failed
> > Is it worth doing that compared to the cost of creating and gc'ing the > > local variable? > Local int variable is not an object. I think that it is created on > stack and there is no gc involved. (I may be wrong here though). A local int resides on the stack, whereas an Integer is an object, and may be on the stack or in the heap. If the JIT (just the C2 compiler only, I think) can determine that the object does not escape the local procedure (and is small enough) it will be on the stack. The escape analysis was implemented by Sun in Java 6 (the IBM JVM had it for some time before that): http://docs.oracle.com/javase/7/docs/technotes/guides/vm/performance-enhancements-7.html#escapeAnalysis - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org