2

I am attempting to install Glassfishv3 on my Ubuntu (8.04) VPS using Java 1.6.

I initially tried starting the server using:

asadmin start-domain

and received the following error message:

JVM failed to start: com.sun.enterprise.admin.launcher.GFLauncherException: 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

Command start-domain failed.

I attempted to run it again and received a different message:

Waiting for DAS 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.

If I run cat /proc/meminfo I get the following (all other values are 0kB):

MemTotal:  1310720 kB 
MemFree:   1150668 kB
LowTotal:  1310720 kB 
LowFree:   1150668 kB

I have checked the contents of glassfish/glassfish/domains/domain1/config/domain.xml and the JVM setting is:

-Xmx512m

Any help on resolving this problem would be appreciated.

1
  • If the virtual server is OpenVZ container, you need enough real RAM memory allocated for you virtual server. Often only part is real ram and part swap.
    – jkj
    Jan 19, 2012 at 8:30

2 Answers 2

1

The error you've got means that JVM couldn't claim enough memory to start. It is possible that mmap call fails in VPS, though you have lots of free memory reported by system, due to memory overcommit mechanism.

Xmx option to JVM is an upper heap memory limit. You may need to tune it, but it should not prevent glassfish from starting. What you need is Xms option. It is 128Mb by default, try to reduce it first.

0

My server memory limits were similar, but I reduced the memory setting of the JVM to 128 and it launched. It seems to fail at 256 though. Not sure if this is related to the "guaranteed" RAM of my VPS.

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .