Method getThreadName() creates a StringBuilder with a capacity that's too small and need to be increased, causing an allocation and copy.
Fix: create a StringBuilder with sufficient capacity, or use String.format(). Also, merge getThreadName() and getNewThreadName().
Todo: look at all uses of StringBuilder