On 12/10/2014 14:22, Caldarale, Charles R wrote: >> 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
Thanks to our resident JVM expert for pointing me in the right direction. Mark --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org