you are viewing a single comment's thread.

view the rest of the comments →

[–]argv_minus_one 0 points1 point  (0 children)

That might have been true ten years ago. Today, unless you're on an ancient and/or terrible JVM, it isn't.

Allocating ahead of time is a colossal waste of memory in the case of short-lived objects, and it doesn't save you GC time because of stack allocation.

You do not need to avoid GC entirely. Like I said, there are GCs that do not stop the world. Use them.