Java should support the creation of objects on the stack. A RFE has been submitted in this sense and needs your vote: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6336351
The problem is simple, and can be illustrated by the following (from JScience benchmark at http://jscience.org):
Matrix and Matrix versus non-parameterized matrix (double)
Non-parameterized matrix (double based) 500x500 multiplication: 3.940 s
Matrix 500x500 multiplication: 25.10 s
Matrix 500x500 multiplication: 28.43 s
Parameterization is great, but who is going to use it if there is there such penality when creating new objects!
This is a serious performance issue…that stack allocation would solve nicely.
By the way the parameterized matrix here uses Javolution (http://javolution.org) pool context for row-column multiplication here, unfortunately the overhead of this “soft” solution is significant for small objects; still without it you would get execution time around 1 min !!!
This could be BIG for games developpers, please cast your vote at: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6336351
One possible implementation (very fast) would be that when you assign a stack object to an object out of the stack you always do a copy (cascading to members on the stack) . Then, resetting the stack is immediat and does not require any kind of gc (no object outside the stack has reference to stack objects) 
In practice, for the developer, it means that objects created while on a stack are “values objects” (manipulated by copy not by reference) they might even be identified by a new interface (e.g. java.lang.Copyable) to avoid problems in case @stack is used at the wrong place (a concern for many it seems).
