You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Maduranga <ma...@gmail.com> on 2008/07/03 15:40:54 UTC
Tomcat Runs OutOfMemory (Not at repeated WAR deployments)
Hi,
Tomcat version "5.5.20"
Java version "1.5.0_09"
I run a production system with an single WAR file which communicates
to an outside-world web-service via a ActiveMQ.
Also it connects to an FTP service and does some image manipulation as well.
Spring is being used for IOC, and JDBC (JDBCTemplate of Spring) is
used for persisting.
When there are heavy queries on server, even though the free memory is
there for JVM it quickly utilizes memory and JVM seems not to garbage
collect even after users logging out.
I changed many JVM parameters with no luck and currently it is:
-server -Xms512m -Xmx2048m -XX:NewSize=128m -XX:MaxNewSize=128m
-XX:SurvivorRatio=4
Found a couple of articles on Tomcat classloader issue, but this is
not rellay at the deployment of the WAR.
Any advice is welcome to enhance this massive page loading slowness
and out-of-memory problem.
Thanks
Maduranga
--
Maduranga
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Tomcat Runs OutOfMemory (Not at repeated WAR deployments)
Posted by Maduranga <ma...@gmail.com>.
I changed options to :
export CATALINA_OPTS="-server -XX:+HeapDumpOnOutOfMemoryError
-verbose:gc -XX:HeapDumpPath=/data02/www2/vhosts/merchants.koodos.com/dumps/
-Xms1024m -Xmx1024m"
Waiting to see the results today. Since a couple of days only this
issue started (OutOfMem..)
I can see the garbage collection happening, but it seems growing in 5
or 10 mb folds.
Still Tomcat is keeping up. After about 8 hours of work only must see
the results as thats the usual time
it crashes.
Thanks
Maduranga
On Fri, Jul 4, 2008 at 5:56 AM, Surendrakumar Viswanathan -X (suviswan
- HCL at Cisco) <su...@cisco.com> wrote:
> Hi
> Add -XX:+HeapDumpOnOutOfMemoryError option to you JVM parameter. It
> will dump the heap (in hprof format) on OOM. You can take the hprof file
> and then analyze using Eclipse MAT (Memory Analyzer tool). This will
> give you information on which objects are getting used most. Based on
> that you can find out the corresponding application code and check
> whether there are memory leak exists in the code.
> The random slowness is usually associated with GC. Enable verboseGC
> with timestamp option and then check whether the GC is happening at the
> corresponding time of slowness.
>
> Suren
>
>> -----Original Message-----
>> From: Maduranga [mailto:maduranga@gmail.com]
>> Sent: Friday, July 04, 2008 3:22 AM
>> To: Tomcat Users List
>> Subject: Re: Tomcat Runs OutOfMemory (Not at repeated WAR deployments)
>>
>> Its 32 bit. Sorry I missed that earlier.
>>
>> Could be a problem with web app. Could you give me an
>> idea/example for a profiler? Any open source ones available?
>>
>> I am really in a tight schedule to get this sorted out. All
>> the help much appreciated Thanks a lot
>>
>> Maduranga
>>
>>
>> On Thu, Jul 3, 2008 at 6:13 PM, Caldarale, Charles R
>> <Ch...@unisys.com> wrote:
>> >> From: Maduranga [mailto:maduranga@gmail.com]
>> >> Subject: Re: Tomcat Runs OutOfMemory (Not at repeated WAR
>> >> deployments)
>> >>
>> >> OS: Red Hat Enterprise Linux AS release 4 (Nahant Update 2)
>> >
>> > Is that 64-bit or 32-bit?
>> >
>> >> I have 2G ram for JVM, but I would like to stick with 1G if its
>> >> possible.
>> >
>> > If that's 2G for the entire JVM process, the maximum heap
>> you can get away with would be somewhere around 1.5G, since
>> there's a fair amount of space needed for code, libraries,
>> file space, etc.
>> >
>> >> Do you recommend upgrading to Tomcat 6?
>> >
>> > Might have some benefit, but you really need to run a
>> profiler to find out what's consuming the memory. The
>> problem is likely to like with your webapp, not Tomcat itself.
>> >
>> > - Chuck
>> >
>> >
>> > THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR
>> OTHERWISE PROPRIETARY MATERIAL and is thus for use only by
>> the intended recipient. If you received this in error, please
>> contact the sender and delete the e-mail and its attachments
>> from all computers.
>> >
>> >
>> ---------------------------------------------------------------------
>> > To start a new topic, e-mail: users@tomcat.apache.org To
>> unsubscribe,
>> > e-mail: users-unsubscribe@tomcat.apache.org
>> > For additional commands, e-mail: users-help@tomcat.apache.org
>> >
>> >
>>
>>
>>
>> --
>> Maduranga
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org To
>> unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
--
Maduranga
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Tomcat Runs OutOfMemory (Not at repeated WAR deployments)
Posted by Maduranga <ma...@gmail.com>.
Thanks a lot for the Tip.
Eclipse MAT helped a lot!
All the best to all of you!!
On Fri, Jul 4, 2008 at 5:56 AM, Surendrakumar Viswanathan -X (suviswan
- HCL at Cisco) <su...@cisco.com> wrote:
> Hi
> Add -XX:+HeapDumpOnOutOfMemoryError option to you JVM parameter. It
> will dump the heap (in hprof format) on OOM. You can take the hprof file
> and then analyze using Eclipse MAT (Memory Analyzer tool). This will
> give you information on which objects are getting used most. Based on
> that you can find out the corresponding application code and check
> whether there are memory leak exists in the code.
> The random slowness is usually associated with GC. Enable verboseGC
> with timestamp option and then check whether the GC is happening at the
> corresponding time of slowness.
>
> Suren
>
>> -----Original Message-----
>> From: Maduranga [mailto:maduranga@gmail.com]
>> Sent: Friday, July 04, 2008 3:22 AM
>> To: Tomcat Users List
>> Subject: Re: Tomcat Runs OutOfMemory (Not at repeated WAR deployments)
>>
>> Its 32 bit. Sorry I missed that earlier.
>>
>> Could be a problem with web app. Could you give me an
>> idea/example for a profiler? Any open source ones available?
>>
>> I am really in a tight schedule to get this sorted out. All
>> the help much appreciated Thanks a lot
>>
>> Maduranga
>>
>>
>> On Thu, Jul 3, 2008 at 6:13 PM, Caldarale, Charles R
>> <Ch...@unisys.com> wrote:
>> >> From: Maduranga [mailto:maduranga@gmail.com]
>> >> Subject: Re: Tomcat Runs OutOfMemory (Not at repeated WAR
>> >> deployments)
>> >>
>> >> OS: Red Hat Enterprise Linux AS release 4 (Nahant Update 2)
>> >
>> > Is that 64-bit or 32-bit?
>> >
>> >> I have 2G ram for JVM, but I would like to stick with 1G if its
>> >> possible.
>> >
>> > If that's 2G for the entire JVM process, the maximum heap
>> you can get away with would be somewhere around 1.5G, since
>> there's a fair amount of space needed for code, libraries,
>> file space, etc.
>> >
>> >> Do you recommend upgrading to Tomcat 6?
>> >
>> > Might have some benefit, but you really need to run a
>> profiler to find out what's consuming the memory. The
>> problem is likely to like with your webapp, not Tomcat itself.
>> >
>> > - Chuck
>> >
>> >
>> > THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR
>> OTHERWISE PROPRIETARY MATERIAL and is thus for use only by
>> the intended recipient. If you received this in error, please
>> contact the sender and delete the e-mail and its attachments
>> from all computers.
>> >
>> >
>> ---------------------------------------------------------------------
>> > To start a new topic, e-mail: users@tomcat.apache.org To
>> unsubscribe,
>> > e-mail: users-unsubscribe@tomcat.apache.org
>> > For additional commands, e-mail: users-help@tomcat.apache.org
>> >
>> >
>>
>>
>>
>> --
>> Maduranga
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org To
>> unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
--
Maduranga
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: Tomcat Runs OutOfMemory (Not at repeated WAR deployments)
Posted by "Surendrakumar Viswanathan -X (suviswan - HCL at Cisco)" <su...@cisco.com>.
Hi
Add -XX:+HeapDumpOnOutOfMemoryError option to you JVM parameter. It
will dump the heap (in hprof format) on OOM. You can take the hprof file
and then analyze using Eclipse MAT (Memory Analyzer tool). This will
give you information on which objects are getting used most. Based on
that you can find out the corresponding application code and check
whether there are memory leak exists in the code.
The random slowness is usually associated with GC. Enable verboseGC
with timestamp option and then check whether the GC is happening at the
corresponding time of slowness.
Suren
> -----Original Message-----
> From: Maduranga [mailto:maduranga@gmail.com]
> Sent: Friday, July 04, 2008 3:22 AM
> To: Tomcat Users List
> Subject: Re: Tomcat Runs OutOfMemory (Not at repeated WAR deployments)
>
> Its 32 bit. Sorry I missed that earlier.
>
> Could be a problem with web app. Could you give me an
> idea/example for a profiler? Any open source ones available?
>
> I am really in a tight schedule to get this sorted out. All
> the help much appreciated Thanks a lot
>
> Maduranga
>
>
> On Thu, Jul 3, 2008 at 6:13 PM, Caldarale, Charles R
> <Ch...@unisys.com> wrote:
> >> From: Maduranga [mailto:maduranga@gmail.com]
> >> Subject: Re: Tomcat Runs OutOfMemory (Not at repeated WAR
> >> deployments)
> >>
> >> OS: Red Hat Enterprise Linux AS release 4 (Nahant Update 2)
> >
> > Is that 64-bit or 32-bit?
> >
> >> I have 2G ram for JVM, but I would like to stick with 1G if its
> >> possible.
> >
> > If that's 2G for the entire JVM process, the maximum heap
> you can get away with would be somewhere around 1.5G, since
> there's a fair amount of space needed for code, libraries,
> file space, etc.
> >
> >> Do you recommend upgrading to Tomcat 6?
> >
> > Might have some benefit, but you really need to run a
> profiler to find out what's consuming the memory. The
> problem is likely to like with your webapp, not Tomcat itself.
> >
> > - Chuck
> >
> >
> > THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR
> OTHERWISE PROPRIETARY MATERIAL and is thus for use only by
> the intended recipient. If you received this in error, please
> contact the sender and delete the e-mail and its attachments
> from all computers.
> >
> >
> ---------------------------------------------------------------------
> > To start a new topic, e-mail: users@tomcat.apache.org To
> unsubscribe,
> > e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
> >
>
>
>
> --
> Maduranga
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org To
> unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Tomcat Runs OutOfMemory (Not at repeated WAR deployments)
Posted by Maduranga <ma...@gmail.com>.
Its 32 bit. Sorry I missed that earlier.
Could be a problem with web app. Could you give me an idea/example for
a profiler? Any open source ones available?
I am really in a tight schedule to get this sorted out. All the help
much appreciated
Thanks a lot
Maduranga
On Thu, Jul 3, 2008 at 6:13 PM, Caldarale, Charles R
<Ch...@unisys.com> wrote:
>> From: Maduranga [mailto:maduranga@gmail.com]
>> Subject: Re: Tomcat Runs OutOfMemory (Not at repeated WAR deployments)
>>
>> OS: Red Hat Enterprise Linux AS release 4 (Nahant Update 2)
>
> Is that 64-bit or 32-bit?
>
>> I have 2G ram for JVM, but I would like to stick with 1G if
>> its possible.
>
> If that's 2G for the entire JVM process, the maximum heap you can get away with would be somewhere around 1.5G, since there's a fair amount of space needed for code, libraries, file space, etc.
>
>> Do you recommend upgrading to Tomcat 6?
>
> Might have some benefit, but you really need to run a profiler to find out what's consuming the memory. The problem is likely to like with your webapp, not Tomcat itself.
>
> - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
--
Maduranga
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: Tomcat Runs OutOfMemory (Not at repeated WAR deployments)
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Maduranga [mailto:maduranga@gmail.com]
> Subject: Re: Tomcat Runs OutOfMemory (Not at repeated WAR deployments)
>
> OS: Red Hat Enterprise Linux AS release 4 (Nahant Update 2)
Is that 64-bit or 32-bit?
> I have 2G ram for JVM, but I would like to stick with 1G if
> its possible.
If that's 2G for the entire JVM process, the maximum heap you can get away with would be somewhere around 1.5G, since there's a fair amount of space needed for code, libraries, file space, etc.
> Do you recommend upgrading to Tomcat 6?
Might have some benefit, but you really need to run a profiler to find out what's consuming the memory. The problem is likely to like with your webapp, not Tomcat itself.
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: Tomcat Runs OutOfMemory (Not at repeated WAR deployments)
Posted by Maduranga <ma...@gmail.com>.
OS: Red Hat Enterprise Linux AS release 4 (Nahant Update 2)
I have 2G ram for JVM, but I would like to stick with 1G if its possible.
With the change of JVM settings still no positive result.. therefore I
will switch back to Xms and Xms as you say. (with a same value -- 1G may be?).
Do you recommend upgrading to Tomcat 6?
Thanks Chuck for your responses, much appreciated!
/Maduranga
On Thu, Jul 3, 2008 at 4:49 PM, Caldarale, Charles R
<Ch...@unisys.com> wrote:
>> From: maduranga@gmail.com [mailto:maduranga@gmail.com]
>> Subject: Tomcat Runs OutOfMemory (Not at repeated WAR deployments)
>>
>> I changed many JVM parameters with no luck and currently it is:
>> -server -Xms512m -Xmx2048m -XX:NewSize=128m -XX:MaxNewSize=128m
>> -XX:SurvivorRatio=4
>
> I would strongly recommend against playing with NewSize, MaxNewSize, or SurvivorRatio; getting them even slightly out of kilter can foul things up pretty quickly.
>
> What platform are you running on? If it's not 64-bit, the -Xmx2048m won't work. How much RAM do you have that you can give to the JVM? Your -Xmx setting must be noticeably smaller than that, or you'll get into page thrashing.
>
> Setting -Xms and -Xmx to the same value is usually benficial.
>
> Moving up to a 1.6 JVM may help.
>
> You should run a heap profiler and find out exactly what is consuming the heap and where it's being allcoated.
>
> - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
--
Maduranga
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
RE: Tomcat Runs OutOfMemory (Not at repeated WAR deployments)
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: maduranga@gmail.com [mailto:maduranga@gmail.com]
> Subject: Tomcat Runs OutOfMemory (Not at repeated WAR deployments)
>
> I changed many JVM parameters with no luck and currently it is:
> -server -Xms512m -Xmx2048m -XX:NewSize=128m -XX:MaxNewSize=128m
> -XX:SurvivorRatio=4
I would strongly recommend against playing with NewSize, MaxNewSize, or SurvivorRatio; getting them even slightly out of kilter can foul things up pretty quickly.
What platform are you running on? If it's not 64-bit, the -Xmx2048m won't work. How much RAM do you have that you can give to the JVM? Your -Xmx setting must be noticeably smaller than that, or you'll get into page thrashing.
Setting -Xms and -Xmx to the same value is usually benficial.
Moving up to a 1.6 JVM may help.
You should run a heap profiler and find out exactly what is consuming the heap and where it's being allcoated.
- Chuck
THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org