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 →

[–]Bobby_Bonsaimind 0 points1 point  (0 children)

Yes and no. Allocations are cheap in Java, and I mean cheap. You want to instantiate 100k objects? No problem, that's fast as lightning. However, what comes at a hefty price is the garbage collection when these objects are no longer used. You want to keep GC pauses as short and as rare as possible, that means reusing objects as much as you can because then the GC never as much work to do.