TempVars.lock()

replacing

new Throwable().getStackTrace();

with

Thread.currentThread().getStackTrace();



does the same, but without new objects every call.