You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Lu...@vwr.com on 2003/04/29 22:39:38 UTC

OutOfMemoryError question

Hello:

I'm running Tomcat4.1 with my company website's search engine.

I'm finding OutOfMemoryErrors throughout the logs.  I'm intending to try
allocating more memory for java.  (So, in my startup.sh script, increase
512 to 768).

      from startup.sh:
            export JAVA_OPTS="-Xms512m -Xmx512m"

I have 4G of memory on the server.  My question is, how is the memory
allocation I make in the startup script related to the min and max
processors?  Given 4G physical memory, if I set memory at 768, must my
maxProcessors in the server.xml for the application be 5 or fewer?

      from server.xml:
            <Connector className
="org.apache.catalina.connector.http.HttpConnector"
            port="8080" minProcessors="5" maxProcessors="75"
            enableLookups="false" redirectPort="8443"
            acceptCount="50" debug="0" connectionTimeout="60000"/>

Thanks for any information.

Lucinda R. Rockemore
VWR International . e-Business
e-mail: lucinda_rockemore@vwr.com
phone: 610 429 2731
fax: 610 429 5559






****************************************************************************************************************

The information contained in this e-mail message may be privileged,
confidential and protected from disclosure.
If you are not the intended recipient, any dissemination, distribution or
copying is strictly prohibited. If you think
that you have received this e-mail message in error please e-mail the
sender and delete the message. Thank you
*****************************************************************************************************************





---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: OutOfMemoryError question

Posted by mike jackson <mj...@cdi-hq.com>.
What OS?  If it's unix check your ulimit (ulimit -a).  If memory isn't
"unlimited" try changing it to "unlimited" and see what happens.  You
can set the limit that the JVM can grab to whatever you want, but if the
host os won't allow it you're going to get out of memory exceptions.  In
my case I was puzzled for 3 days until I figured it out.

--mikej
-=------
mike jackson
mjackson@cdi-hq.com

> -----Original Message-----
> From: Lucinda_Rockemore@vwr.com [mailto:Lucinda_Rockemore@vwr.com]
> Sent: Tuesday, April 29, 2003 12:40 PM
> To: tomcat-user@jakarta.apache.org
> Subject: OutOfMemoryError question
> 
> Hello:
> 
> I'm running Tomcat4.1 with my company website's search engine.
> 
> I'm finding OutOfMemoryErrors throughout the logs.  I'm intending to
try
> allocating more memory for java.  (So, in my startup.sh script,
increase
> 512 to 768).
> 
>       from startup.sh:
>             export JAVA_OPTS="-Xms512m -Xmx512m"
> 
> I have 4G of memory on the server.  My question is, how is the memory
> allocation I make in the startup script related to the min and max
> processors?  Given 4G physical memory, if I set memory at 768, must my
> maxProcessors in the server.xml for the application be 5 or fewer?
> 
>       from server.xml:
>             <Connector className
> ="org.apache.catalina.connector.http.HttpConnector"
>             port="8080" minProcessors="5" maxProcessors="75"
>             enableLookups="false" redirectPort="8443"
>             acceptCount="50" debug="0" connectionTimeout="60000"/>
> 
> Thanks for any information.
> 
> Lucinda R. Rockemore
> VWR International . e-Business
> e-mail: lucinda_rockemore@vwr.com
> phone: 610 429 2731
> fax: 610 429 5559
> 
> 
> 
> 
> 
> 
>
************************************************************************
**
> **************************************
> 
> The information contained in this e-mail message may be privileged,
> confidential and protected from disclosure.
> If you are not the intended recipient, any dissemination, distribution
or
> copying is strictly prohibited. If you think
> that you have received this e-mail message in error please e-mail the
> sender and delete the message. Thank you
>
************************************************************************
**
> ***************************************
> 
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Each webapp has its JVM?

Posted by Charles So <ch...@mac.com>.
Hello,

I am investigating the possibility of having seperate JVM for each 
webapp so that I can achieve better availability.

Is this possible?

If possible, will i be able to do load balancing in TC afterward???

Thanks in advance!


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: OutOfMemoryError question

Posted by Brian Briggman <b....@attbi.com>.
The memory you allocate via the -Xmx option is the total memory for the JVM.
The processors you allocate in server.xml equate to JVM threads.  Threads
each take up an average of 528kB each from the memory you allocate to the
JVM(the actual default setting can vary based on JVM version, use of a
HotSpot JVM, etc...read up on the -Xss and -Xoss parameters, but you usually
don't want to change these!)  So, if you've allocated 512MB for the JVM,
assuming minimal static overhead, you should be able to handle somewhere
around 1000 simultaneous threads.  If you're experiencing that kind of
activity, you definitely want to look into increasing the memory you
allocate to the JVM.  Keep in mind that another way to get OutOfMemoryErrors
is to exceed the thread memory with objects you create during the lifetime
of the thread (this usually occurs when an application does things like
passing around large ResultSets, or creating large multi-dimensional
arrays...)  If you've got 4GB on the box, and Tomcat is all you've got
running there, there's no reason not to go up to 3g, but initially you may
want to try increasing the max memory to 1024m or 1g (and also change the
startup memory to match - having the starting and maximum heap values match
can result in better performance because the OS will not have to dynamically
allocate more memory to your VM while you're running).  Also keep in mind
that you can't exceed a heap size of 2GB with a JVM 1.3.0 or earlier...

Hope this helps,
Brian

-----Original Message-----
From: Lucinda_Rockemore@vwr.com [mailto:Lucinda_Rockemore@vwr.com]
Sent: Tuesday, April 29, 2003 3:40 PM
To: tomcat-user@jakarta.apache.org
Subject: OutOfMemoryError question


Hello:

I'm running Tomcat4.1 with my company website's search engine.

I'm finding OutOfMemoryErrors throughout the logs.  I'm intending to try
allocating more memory for java.  (So, in my startup.sh script, increase
512 to 768).

      from startup.sh:
            export JAVA_OPTS="-Xms512m -Xmx512m"

I have 4G of memory on the server.  My question is, how is the memory
allocation I make in the startup script related to the min and max
processors?  Given 4G physical memory, if I set memory at 768, must my
maxProcessors in the server.xml for the application be 5 or fewer?

      from server.xml:
            <Connector className
="org.apache.catalina.connector.http.HttpConnector"
            port="8080" minProcessors="5" maxProcessors="75"
            enableLookups="false" redirectPort="8443"
            acceptCount="50" debug="0" connectionTimeout="60000"/>

Thanks for any information.

Lucinda R. Rockemore
VWR International . e-Business
e-mail: lucinda_rockemore@vwr.com
phone: 610 429 2731
fax: 610 429 5559






****************************************************************************
************************************

The information contained in this e-mail message may be privileged,
confidential and protected from disclosure.
If you are not the intended recipient, any dissemination, distribution or
copying is strictly prohibited. If you think
that you have received this e-mail message in error please e-mail the
sender and delete the message. Thank you
****************************************************************************
*************************************





---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org