...
Adjust the number on the -Xmx parameter to a suitable value. Do not allocate more than your physically available memory. A good rule of thumb is to leave 1GB to your operating system and the other services. So if you have a 4GB machine, the maximum memory you could safely allocate would be 3072MB (3GB).