users@glassfish.java.net

Re: Memory/JVM setup to run glassfish 3.1.1... am i missing something obvious???

From: Alexis Moussine-Pouchkine <alexis.moussine-pouchkine_at_oracle.com>
Date: Mon, 26 Dec 2011 21:33:42 +0100

The server log (domain1/logs/server.log) should say why the JVM cannot be created.
Generally speaking GlassFish doesn't rely on environment variables and thus is not picking up your JAVA_OPTS.
You should set the JVM options using "asadmin create-jvm-options -Xmx384m" which should add the appropriate entries in domain1/config/domain.xml

You can try starting server using :
        java -server -XX:PermSize=256m -Xms512m -Xmx512m -jar modules/glassfish.jar

or more generally like this in verbose/interactive mode :
        asadmin start-domain -v

Giving 2/3rd of the heap to the permgen seems excessive btw.

cheers,
-Alexis


On 26 déc. 2011, at 20:09, forums_at_java.net wrote:

> It seems there is enough free memory (over 1 GB) but glassfish won't start on
> this 32 bit CentOS server. Tomcat starts fine with these JVM settings (i
> tried lots of mem sizes in JAVA_OPTS below):
>
> /opt/glassfish3>set | grep JAVA
> JAVA_HOME=/opt/jdk
> JAVA_OPTS='-server -XX:PermSize=256m -Xms384 -Xmx384'
>
> /opt/glassfish3>cat /proc/meminfo
> MemTotal: 2097152 kB
> MemFree: 1324648 kB
>
> /opt/glassfish3>ulimit -a
> max locked memory (kbytes, -l) 32
> max memory size (kbytes, -m) unlimited
> stack size (kbytes, -s) 10240
>
> /opt/glassfish3>which java
> /opt/jdk/bin/java
> /opt/glassfish3>java -version
> java version "1.6.0_26"
> Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
> Java HotSpot(TM) Server VM (build 20.1-b02, mixed mode)
>
> /opt/glassfish3/bin>./asadmin start-domain
> Waiting for domain1 to start .Error starting domain domain1.
> The server exited prematurely with exit code 1.
> Before it died, it produced the following output:
> Error occurred during initialization of VM
> Could not reserve enough space for object heap
> Could not create the Java virtual machine.
> Command start-domain failed.
>
>
> --
>
> [Message sent by forum member 'pkcinna']
>
> View Post: http://forums.java.net/node/877603
>
>