tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: what is the upper limit of maximum heap memory for Tomcat with 32-bit JVM running on Red Hat Linux 4 (32-bit)
Date Fri, 24 Jul 2009 19:31:34 GMT
-----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: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message