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
-Xms512m
-Xmx1g
AFAIK One more reason, is that expansion of heap is a stop-the-world event; setting those to the same value will prevent that.
stop-the-world