If you happen to rent a virtual server, you might want to check the mem limits first before starting an endeavour to install Glassfish on it. The installer requires more than 256MB which is the confirmed available memory of my virtual box. I get this straight away:
h000000:/opt # sudo java -Xmx256m -jar glassfish-installer-v2ur2-b04-linux.jar
Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
Doesnt matter what mem value I assign, I get the same answer. I gave up on this and move on to another (bigger) V server.