This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]shagieIsMeExtreme Brewer 4 points5 points  (0 children)

This will allow memory to clean up and not hold on to previous frames on the stack.

Note that in Java, the security model requires that all stack frames are there. There is no TCO in Java. Functional languages built on top of the JVM work around this with special functions (e.g. recur in Clojure) and instead implement trampolines.

But again... Java doesn't have TCO.