You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Daniel Blumenthal <da...@wordchamp.com> on 2006/10/07 06:37:49 UTC
Java heap space
I've been running a struts app on a plain vanilla install of Tomcat
(5.0.28), and recently I've been getting some OutOfMemoryErrors. I did some
looking, and found the -Xms and -Xmx flags, and was hoping to get some
advice regarding good values.
I'm upgrading to a couple of RH Linux servers which will only be running
apache and tomcat (the database will be on other machines). Each server has
4GB of memory. What would reasonable values be to get the best performance
out of Tomcat?
Thanks!
---------------------------------------------------------------------
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: Java heap space
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Santosh Puranshettiwar [mailto:santosh@wirkle.com]
> Subject: Re: Java heap space
>
> Are you sure there isn't any memory leak?
Extremely likely that there's a memory leak in the application. First,
read the FAQ:
http://tomcat.apache.org/faq/memory.html
There are numerous discussions about this and using profilers in the
archives, so try searching there:
http://marc.theaimsgroup.com/?l=tomcat-user&r=1&w=2
For a heap tuning discussion, read:
http://java.sun.com/docs/hotspot/gc5.0/gc_tuning_5.html
- 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: Java heap space
Posted by Leon Rosenberg <ro...@googlemail.com>.
I would also add that an OutOfMemory doesn't always mean heap.
try increasing your PermSpaceSize:
-XX:MaxPermSize=256m
if you have many classes and jsps it can be your problem.
regards
leon
On 10/8/06, Caldarale, Charles R <Ch...@unisys.com> wrote:
> > From: Daniel Blumenthal [mailto:daniel@wordchamp.com]
> > Subject: RE: Java heap space
> >
> > It's more that I wonder if I should bump the number up to
> > -Xmx2048m.
>
> Too big for 32-bit Windows (or most other 32-bit OS implementations),
> but is o.k. for 64-bit.
>
> > Is there a reason to choose 256m?
>
> Not particularly. Whoever suggested that was just taking a stab in the
> dark. 256m is pretty small these days.
>
> > What is the default? The maximum?
>
> Depends on the platform (Windows, Solaris, Linux, ??; IA32, IA64, Sparc,
> ???), and whether you're using the -server or -client options. Provide
> your specifics, and I'll look it up.
>
> - 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
>
>
---------------------------------------------------------------------
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: Java heap space
Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Daniel Blumenthal [mailto:daniel@wordchamp.com]
> Subject: RE: Java heap space
>
> It's more that I wonder if I should bump the number up to
> -Xmx2048m.
Too big for 32-bit Windows (or most other 32-bit OS implementations),
but is o.k. for 64-bit.
> Is there a reason to choose 256m?
Not particularly. Whoever suggested that was just taking a stab in the
dark. 256m is pretty small these days.
> What is the default? The maximum?
Depends on the platform (Windows, Solaris, Linux, ??; IA32, IA64, Sparc,
???), and whether you're using the -server or -client options. Provide
your specifics, and I'll look it up.
- 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: Java heap space
Posted by Daniel Blumenthal <da...@wordchamp.com>.
The problem has only occurred twice, so I can't reliably reproduce it. It's
more that I wonder if I should bump the number up to -Xmx2048m. Is there a
reason to choose 256m? What is the default? The maximum?
> -----Original Message-----
> From: Martin Gainty [mailto:mgainty@hotmail.com]
> Sent: Saturday, October 07, 2006 2:48 PM
> To: Tomcat Users List; daniel@wordchamp.com
> Subject: Re: Java heap space
>
> Dan
> What happens when you increase your JVM max memory parameter
> (say to 256MB) with -Xmx256m in your
> %java_home%\jre\lib\jvm.cfg restart tomcat?
> Martin --
>
> This e-mail communication and any attachments may contain
> confidential and privileged information for the use of the
> designated recipients named above. If you are not the
> intended recipient, you are hereby notified that you have
> received this communication in error and that any review,
> disclosure, dissemination, distribution or copying of it or
> its contents
> ----- Original Message -----
> From: "Daniel Blumenthal" <da...@wordchamp.com>
> To: "'Tomcat Users List'" <us...@tomcat.apache.org>
> Sent: Saturday, October 07, 2006 12:21 PM
> Subject: RE: Java heap space
>
>
> > The quick answer is no - all of the code is non-reentrant,
> and there
> > aren't many places for a memory leak to hide from the garbage
> > collector, but saying that there isn't a leak is like
> saying your code
> > is bug free. The one area that is suspect is the database
> code - I'm
> > fairly careful, but every once in a while I find a
> PreparedStatement or ResultSet that isn't closed...
> >
> > Still, these are two different tracks. I'd like to get Java set up
> > correctly to give maximum memory to Tomcat, while simultaneously
> > trying to track down any leaks.
> >
> > Daniel
> >
> >
> >> -----Original Message-----
> >> From: Santosh Puranshettiwar [mailto:santosh@wirkle.com]
> >> Sent: Saturday, October 07, 2006 6:00 AM
> >> To: Tomcat Users List
> >> Subject: Re: Java heap space
> >>
> >> Are you sure there isn't any memory leak? I mean it might happen
> >> that you are increasing the heap size just to delay the
> >> OutOfMemoryErrors.
> >>
> >> Santosh.
> >>
> >> Daniel Blumenthal wrote:
> >> > I've been running a struts app on a plain vanilla
> install of Tomcat
> >> > (5.0.28), and recently I've been getting some
> OutOfMemoryErrors. I
> >> > did some looking, and found the -Xms and -Xmx flags, and
> >> was hoping to
> >> > get some advice regarding good values.
> >> >
> >> > I'm upgrading to a couple of RH Linux servers which will only be
> >> > running apache and tomcat (the database will be on other
> >> machines).
> >> > Each server has 4GB of memory. What would reasonable
> >> values be to get
> >> > the best performance out of Tomcat?
> >> >
> >> > Thanks!
> >> >
> >> >
> >> >
> >> >
> >> >
> >>
> ---------------------------------------------------------------------
> >> > 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
> >>
> >>
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > 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: Java heap space
Posted by Martin Gainty <mg...@hotmail.com>.
Dan
What happens when you increase your JVM max memory parameter (say to 256MB)
with -Xmx256m in your %java_home%\jre\lib\jvm.cfg
restart tomcat?
Martin --
This e-mail communication and any attachments may contain confidential and privileged information for the use of the
designated recipients named above. If you are not the intended recipient, you are hereby notified that you have received
this communication in error and that any review, disclosure, dissemination, distribution or copying of it or its
contents
----- Original Message -----
From: "Daniel Blumenthal" <da...@wordchamp.com>
To: "'Tomcat Users List'" <us...@tomcat.apache.org>
Sent: Saturday, October 07, 2006 12:21 PM
Subject: RE: Java heap space
> The quick answer is no - all of the code is non-reentrant, and there aren't
> many places for a memory leak to hide from the garbage collector, but saying
> that there isn't a leak is like saying your code is bug free. The one area
> that is suspect is the database code - I'm fairly careful, but every once in
> a while I find a PreparedStatement or ResultSet that isn't closed...
>
> Still, these are two different tracks. I'd like to get Java set up
> correctly to give maximum memory to Tomcat, while simultaneously trying to
> track down any leaks.
>
> Daniel
>
>
>> -----Original Message-----
>> From: Santosh Puranshettiwar [mailto:santosh@wirkle.com]
>> Sent: Saturday, October 07, 2006 6:00 AM
>> To: Tomcat Users List
>> Subject: Re: Java heap space
>>
>> Are you sure there isn't any memory leak? I mean it might
>> happen that you are increasing the heap size just to delay
>> the OutOfMemoryErrors.
>>
>> Santosh.
>>
>> Daniel Blumenthal wrote:
>> > I've been running a struts app on a plain vanilla install of Tomcat
>> > (5.0.28), and recently I've been getting some OutOfMemoryErrors. I
>> > did some looking, and found the -Xms and -Xmx flags, and
>> was hoping to
>> > get some advice regarding good values.
>> >
>> > I'm upgrading to a couple of RH Linux servers which will only be
>> > running apache and tomcat (the database will be on other
>> machines).
>> > Each server has 4GB of memory. What would reasonable
>> values be to get
>> > the best performance out of Tomcat?
>> >
>> > Thanks!
>> >
>> >
>> >
>> >
>> >
>> ---------------------------------------------------------------------
>> > 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
>>
>>
>
>
>
> ---------------------------------------------------------------------
> 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: Java heap space
Posted by Daniel Blumenthal <da...@wordchamp.com>.
The quick answer is no - all of the code is non-reentrant, and there aren't
many places for a memory leak to hide from the garbage collector, but saying
that there isn't a leak is like saying your code is bug free. The one area
that is suspect is the database code - I'm fairly careful, but every once in
a while I find a PreparedStatement or ResultSet that isn't closed...
Still, these are two different tracks. I'd like to get Java set up
correctly to give maximum memory to Tomcat, while simultaneously trying to
track down any leaks.
Daniel
> -----Original Message-----
> From: Santosh Puranshettiwar [mailto:santosh@wirkle.com]
> Sent: Saturday, October 07, 2006 6:00 AM
> To: Tomcat Users List
> Subject: Re: Java heap space
>
> Are you sure there isn't any memory leak? I mean it might
> happen that you are increasing the heap size just to delay
> the OutOfMemoryErrors.
>
> Santosh.
>
> Daniel Blumenthal wrote:
> > I've been running a struts app on a plain vanilla install of Tomcat
> > (5.0.28), and recently I've been getting some OutOfMemoryErrors. I
> > did some looking, and found the -Xms and -Xmx flags, and
> was hoping to
> > get some advice regarding good values.
> >
> > I'm upgrading to a couple of RH Linux servers which will only be
> > running apache and tomcat (the database will be on other
> machines).
> > Each server has 4GB of memory. What would reasonable
> values be to get
> > the best performance out of Tomcat?
> >
> > Thanks!
> >
> >
> >
> >
> >
> ---------------------------------------------------------------------
> > 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
>
>
---------------------------------------------------------------------
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: Java heap space
Posted by Santosh Puranshettiwar <sa...@wirkle.com>.
Are you sure there isn't any memory leak? I mean it might happen that
you are increasing the heap size just to delay the OutOfMemoryErrors.
Santosh.
Daniel Blumenthal wrote:
> I've been running a struts app on a plain vanilla install of Tomcat
> (5.0.28), and recently I've been getting some OutOfMemoryErrors. I did some
> looking, and found the -Xms and -Xmx flags, and was hoping to get some
> advice regarding good values.
>
> I'm upgrading to a couple of RH Linux servers which will only be running
> apache and tomcat (the database will be on other machines). Each server has
> 4GB of memory. What would reasonable values be to get the best performance
> out of Tomcat?
>
> Thanks!
>
>
>
>
> ---------------------------------------------------------------------
> 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