Is Java automatic heap increase "transparent" or it have a cost?

Viewed 424

Is it preferable set with -Xms<> parameter to JVM the expected memory or is it better to leave it in automatic? I mean, if I know that my application will use at least 500MB of RAM and maximum 1 GB (used random numbers), would setting the parameters to the JVM be better? I know that if you have a bigger heap the consequence is that you have longer wait time but if the heap is almost finished, should the JVM relocate the occupied memory (losing precious time)?

1 Answers
Related