You can grow to 4GB on a 32 bit system. If you're moving a 64 bit system you can go great. No need to suffer if you've chosen incorrectly if you require for 5g on a 32-bit system java will fret about an invalid value and quit.
cmd-line flags - e.g.
java -Xmx6g myprogram
You can get a complete list (or a nearly full list, anyway) by typing java -X.