Usually I set -Xms512m
and -Xmx1g
so that when JVM starts it allocates 512MB and gradually increases heap to 1GB as necessary. But I see these values s
There are some advantages.
In general, I would make the Xms a value I am confident it will use, and the double this for head room for future use cases or situations we haven't tested for. i.e. a size we don't expect but it might use.
In short, the maximum is the point you would rather the program fail than use any more.