Follow the instructions described in the Sun GlassFish Enterprise Server Installation Guide. Remember to reboot the system after configuring shared memory settings.