Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
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 '12 at 8:30

2 Answers 2

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.

share|improve this answer
2  
If the host would have been OpenVZ with overcommited memory, then it could not get you one large memory block , which might JVM have wanted ... articles like geekfeat.com/2010/04/openvz-vs-xen-memory-usage take on this –  Qiqi Jan 30 '11 at 3:18

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.