Re: Error occurred during initialization of VM
Nigel Wade wrote:
Man Alive wrote:
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.
The virtual address space for a 32-bit process on Solaris
(SPARC; x86/x64 is different) is about 3.996GB; there are "holes"
of 64KB at the low end and 4176KB at the high end. Usually a
process loses a little more space to things like "guard pages;"
I don't know how much fragmentation the JVM incurs. (The O.P.
could use "pmap" against his running JVM to see the details.)
But, check your ulimit for virtual memory. That may be restricting the maximum
memory you are allowed to allocate.
This is possible, but it seems unlikely: His memory settings
are probably the same for all the programs he runs, and if ulimit
were capping his usage you'd expect none of his other Java stuff
would run, either.
I'm afraid I don't have a clue about what exactly goes on
during Tomcat shutdown, but one thing that *might* be worth
checking is the amount of swap space configured on the system.
The O.P. says he's got 4GB of physical memory, and if Tomcat is
already running and there's not much swap space, it may be that
the swap is oversubscribed. (Solaris doesn't "overcommit" swap
space as freely as some other operating systems do.)
--
Eric Sosman
esosman@ieee-dot-org.invalid