Error occurred during initialization of VM

M

Man Alive

When I shutdown a Tomcat, I receive the following message:

"Error occurred during initialization of VM
Could not reserve enough space for object heap"

The setting I have for memory allocation is "-Xmx2048m -Xms2048m".

I can't understand why the message appears as I have ample RAM: 4GB.

Server stats:

Sun V240
Operating System: Solaris 9
RAM: 4GB
 
O

Owen Jacobson

Man said:
When I shutdown a Tomcat, I receive the following message:

"Error occurred during initialization of VM
Could not reserve enough space for object heap"

The setting I have for memory allocation is "-Xmx2048m -Xms2048m".

I can't understand why the message appears as I have ample RAM: 4GB.

On Windows, any *process* (not thread) is only allowed to allocate at
most 2GB of address space[0]. The JVM does not use any of the memory-
mapping tricks[1] necessary to access more than 2GB of RAM through a
smaller address space range, so the JVM, in turn, can allocate at most
2GB of RAM. This includes the memory required to map in the JVM code
and to set up the stack, as well as the JVM's object heap and relevant
bookkeeping data.

So the most RAM you can assign to the JVM on Windows is going to be
somewhat less than 2048 MB.

Note that this limit is per-process; thus, a machine with 32GB of
physical RAM is able to use all of it, but any one program can only
use at most 2GB of it.

Windows' in-process code and data occupies the "other" 2GB of the 4GB
32-bit address space.

[0] Or 3GB if Windows was started with the /3GB switch. See <http://
blogs.msdn.com/oldnewthing/archive/2004/08/22/218527.aspx> for a very
thorough discussion of the tradeoffs involved.
[1] Shades of bank-switched memory...
 
G

Gilbert

Man said:
When I shutdown a Tomcat, I receive the following message:

"Error occurred during initialization of VM
Could not reserve enough space for object heap"

The setting I have for memory allocation is "-Xmx2048m -Xms2048m".

I can't understand why the message appears as I have ample RAM: 4GB.

Server stats:

Sun V240
Operating System: Solaris 9
RAM: 4GB

I've seen this before on Windows boxes when initialising the JVM. There
appears to be a limit to the memory the JVM can address. The JVM version we
were using wouldn't start with -XMX much over 1.7GB as I remember.

However, this doesn't explain why you are seeing this when you shutdown
Tomcat.
 
S

Steve Wampler

Owen said:
Man said:
I can't understand why the message appears as I have ample RAM: 4GB.

On Windows, any *process* (not thread) is only allowed to allocate at
most 2GB of address space[0].

Isn't the OP running Solaris and not Windows? Maybe JVMs have the
same issue on Solaris 9?
 
P

Patricia Shanahan

Man said:
When I shutdown a Tomcat, I receive the following message:

"Error occurred during initialization of VM
Could not reserve enough space for object heap"

The setting I have for memory allocation is "-Xmx2048m -Xms2048m".

I can't understand why the message appears as I have ample RAM: 4GB.

Server stats:

Sun V240
Operating System: Solaris 9
RAM: 4GB

Are you running a 32 bit or 64 bit JVM?

Patricia
 
R

Roedy Green

The setting I have for memory allocation is "-Xmx2048m -Xms2048m".

I can't understand why the message appears as I have ample RAM: 4GB.

First, what is the address space per task on that architecture. 2G 4G?
Consider also how much other junk fits in that address space, possibly
the OS, your code, your stacks. There is precious little left for the
heap.
 
N

Nigel Wade

Man said:
When I shutdown a Tomcat, I receive the following message:

"Error occurred during initialization of VM
Could not reserve enough space for object heap"

The setting I have for memory allocation is "-Xmx2048m -Xms2048m".

I can't understand why the message appears as I have ample RAM: 4GB.

Server stats:

Sun V240
Operating System: Solaris 9
RAM: 4GB

I think that in 32bit Solaris a process can be up to 4GB (I don't have any 32bit
Solaris boxes with sufficient memory to verify this), so a 2GB heap ought to be
ok. Are you using 32 or 64bit Solaris (I think the 240 can run 64bit), if it's
64bit then this is probably not the issue.

But, check your ulimit for virtual memory. That may be restricting the maximum
memory you are allowed to allocate.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,701
Latest member
XavierQ83

Latest Threads

Top