-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Henry,
On 7/23/2009 7:01 PM, Li,Henry wrote:
> I got java.lang.OutOfMemoryError
> Current configuration: -Xms1024M -Xmx2304M
> The host server has about 4.5G free memory. When I tried to increase
> -Xmx2304M to -Xmx3000M, I got this error:
> Error occurred during initialization of VM, Could not reserve enough space
> for object heap
> The maximum # I can reach is -Xmx2680M.
Try running this script:
#!/bin/sh
initial_max=4097
max=${initial_max}
return_value=1
while [ "1" == "$return_value" ] ; do
max=`expr ${max} - 1`
if [ "0" == `expr ${max} % 100` ] ; then
echo "(max=${max})"
fi
java -Xms${max}M -Xmx${max}M MemoryInfo > /dev/null 2>&1
return_value=$?
done
echo
echo Stopped with max=${max}
echo Return value was ${return_value}
(MemoryInfo is a simple Java class that dumps out the memory info for
the JVM)
> QUESTION: Is there an upper limit for -Xmx?
It depends heavily on your environment. It's usually somewhere around
2GB. You seem to be able to get more out of your environment than most
people can.
> What is the work around?
Use a 64-bit JVM on a 64-bit OS.
> How can I use my free memory on the server to
> get rid of the OutOfMemoryError?
You cannot. :(
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkpqDBYACgkQ9CaO5/Lv0PDDIgCfSV9ykYUIoUrivmDdP9YAmDCR
wrMAoIWb5PPilvN5VvYF0hIXMf/Lqzvy
=2SrY
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]