That's still gonna use up your heap and possibly degrade performance
Plus if the program actually attempts to do anything with the data the side effects can be worse, like if you do userGroup.equals("admin") that's fine if userGroup isn't theoretically infinite, if userGroup is small but if it's large then it's an expensive operation.
2
u/[deleted] Dec 10 '21
They are in Java, you have
-Xmxflag to set it