Hi All,
I'm working on a web application which uses Struts JSPs.
Platform : Linux
Servlet Engine : Tomcat 5.5
Java version: Java HotSpot(TM) Client VM (build 1.5.0_02-b09, mixed
mode, sharing)
with the following settings.
JAVA_OPTS=-Xms512m -Xmx512m
JAVA_OPTS=$JAVA_OPTS -verbose:gc
From: dharshana vanderbona [mailto:[EMAIL PROTECTED]
Subject: Fwd: garbage collection problem with class
sun.reflect.GeneratedMethodAccessor
After running the system for sometime with around 50 users I noticed
that the system is starting to fillup the memory. But strangely even
after all
How is garbage collection controlled in Tomcat 5.5? I ran a bit of an
experiment by profiling Tomcat 5.5.7 while running a web application. I
ran a load test against the application that finished with the allocated
object size just below the heap size. If it grew any more, garbage
collection would
Hi There,
Tomcat does not control the garbage collection, it is up to the JVM to
decide if and when a garbage collection is performed. The only way you can
request a garbage collection is by using the System.gc() method, which the
JVM can ignore.
For more information on this Topic read
Right, my question was whether or not Tomcat would call System.gc() to
'suggest' to the JVM that garbage collection take place. Tomcat itself
is the best authority as to how busy it is. Since Tomcat has been around
for a long time I figured that this might have been implemented at some
point
: Garbage Collection
Right, my question was whether or not Tomcat would call System.gc() to
'suggest' to the JVM that garbage collection take place. Tomcat itself is the
best authority as to how busy it is. Since Tomcat has been around for a long
time I figured that this might have been implemented
Calling System.gc() is considered to be a bad thing since this would
trigger a major garbage collection which would take relatively long,
compared with a minor collection.
Besides this: Tomcat knows that it has nothing to do in right this
moment. But does that mean that is always a good idea
I'd rather have a major garbage collection kick off with no users logged
in vs. 100 users logged in. My application pulls data from a database
and generates charts on the fly. Both of those operations require object
creation. So my heap usage grows over time. My usage trends tend to be
bunched
If you know that no or only few users are currently logged in, you can
trigger System.gc() yourself.
I think Tomcat has no reliable way to know how busy its webapps
currently are.
Durfee, Bernard wrote:
I'd rather have a major garbage collection kick off with no users logged
in vs. 100 users
currently are.
Durfee, Bernard wrote:
I'd rather have a major garbage collection kick off with no users logged
in vs. 100 users logged in. My application pulls data from a database
and generates charts on the fly. Both of those operations require object
creation. So my heap usage grows over time
Hi,
The memory sizes are
checked every day with the ps -o time,etime,pcpu,pmem,vsize,rssize
command.
This is a sub-optimal method for tracking memory usage for a JVM. The
reason is that what you're tracking with the above command is the
OS-level memory usage, which includes a lot of stuff
,rssize
command.
The third party suggests that the problems could be due to garbage
collection configuration in tomcat and would like us first to consult with
'tomcat experts'.
If you have expertise with tomcat and are reading this could you please
confirm for us:
1. Is there any garbage collection
1. No there is no Garbage Collection configuration in tomcat. This is controlled by
the JVM.
2. This is not possible. Garbage collection is kicked off when a pool in the JVM fills
up and clears up all expired objects. For there to be a memory leak then there must be
something keeping a handle
increasing the memory allocated from the Windows Server 2003
O/S.
Could this be a issue with the Windows server 2003 garbage collection as I read it is
written using C#? anyone has any idea if this is the problem?
Any help would be very much appreciated.
Thanks
Travis
are you starting tomcat - as service or as application?
Could this be a issue with the Windows server 2003 garbage collection as I
read it is written using C#? anyone has any idea if this is the problem?
No.
Windows 2003 server has nothing to do with applications garbage collection.
Java JVM have
memory.)
I was thinking its a windows 2003 garbage collection issue as they seem to
have changed their memory handing concept and now use the garbage collection
concept. In windows 2000, it was different. And when we were running our
webapps on windows 2000, it was fine. Unfortunately we recently
I'd use Windows 2003 (or .NET Server if you like) and there is no
Garbage Collection to the application. About internal kernel management
I don't know, but applications can't use it. Applications have to use
there own algorithms. It would simply be impossible to redesign this for
the Windows
Typically a JVM doesn't release memory to the OS.
Removeing references to the objects should be enough. (Via explicit setting
to null, or letter a variable fall out of scope from its block)
-Tim
Emre wrote:
Where and when does garbage collection happen in the JSP pages.
In my jsp pages I use
Where and when does garbage collection happen in the JSP pages.
In my jsp pages I use beans as well as importing some of my own java
objects. What I am wondering is if I have to explicitly get rid of these
objects. Because the memory usage never seems to go down during off peak
hours.
Any
Hey
I know that this is an old and a quite recurring issue here, but after
spending some time going through the archives and googling around I'm
still a bit confused.
The problem is relatively simple. I have a singleton class which takes a
lot of time to initialize and I need to understand if
On Wed, Apr 14, 2004 at 09:46:12PM +0100, Tiago Matias wrote:
: As a side question, if the singleton life cycle can not be easily
: controlled or known, what is the best way to perform an one-time
: expensive initialization?
If it's just general init activity (say, loading a config file),
do a
Can anybody tell me if these look like healthy garbage collections.
[GC [ParNew: 3968K-0K(4032K), 0.0132890 secs] 25349K-22156K(56072K),
0.0134572 secs]
[GC [ParNew: 3952K-0K(4032K), 0.0086222 secs] 26109K-22649K(56072K),
0.0087891 secs]
[GC [ParNew: 3953K-0K(4032K), 0.0092634 secs]
your heap size remains stable according to the verbose GC. That in itself doesn't tell
you if there is a problem or not. Is there some slowness in your jsp?
you might want to d/l borland optimizeIt trial version and get a better picture of
what is happening.
peter
Rob Wichterman [EMAIL
:[EMAIL PROTECTED]
Sent: Tuesday, March 30, 2004 1:08 PM
To: Tomcat Users List
Subject: Re: Garbage Collection
your heap size remains stable according to the verbose GC. That in itself
doesn't tell you if there is a problem or not. Is there some slowness in
your jsp?
you might want to d/l borland
issues but the odd thing is we
have never been able to duplicate this problem in our testing environment
only in production.
-Original Message-
From: Peter Lin [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 30, 2004 1:08 PM
To: Tomcat Users List
Subject: Re: Garbage Collection
your heap size
:[EMAIL PROTECTED]
Sent: Tuesday, March 30, 2004 1:08 PM
To: Tomcat Users List
Subject: Re: Garbage Collection
your heap size remains stable according to the verbose GC. That in itself
doesn't tell you if there is a problem or not. Is there some slowness in
your jsp?
you might want to d/l borland
Til:'Tomcat Users List' [EMAIL PROTECTED]
cc:
Vedr.: Garbage Collection issues
My Tomcat 4.1 (hosted on Linux) seems to have a problem in recent months
with crashing due to unavailable free RAM. Specifically I get a
java.error.outOfMemory exception. If check the RAM
ChemInformatics
-Original Message-
From: Neal [mailto:[EMAIL PROTECTED]
Sent: Sunday, November 30, 2003 8:21 PM
To: 'Tomcat Users List'
Subject: Garbage Collection issues
My Tomcat 4.1 (hosted on Linux) seems to have a problem in recent
months
with crashing due to unavailable free RAM
When I said that surely it can't be a memory leak in my app I was operating under
the assumption that the JRE runs garbage collection periodically anywayis this not
true?
If I was waisting resources and not releasing them in a way that the GC could take
them back when it runs
Neal,
When I said that surely it can't be a memory leak in my app I was
operating under the assumption that the JRE runs garbage collection
periodically anywayis this not true?
The GC is pretty much free to run whenever it wants. Often, it will not
run until you get very close to running out
run garbage collection however my RAM totally
frees up and all is well (Runtime.getRuntime().gc();).
Why would this happen? Surely this isn't due to a programming error on
my part, otherwise, the resources should automatically released whenever
the JRE performs periodic garbage collection. Isn't
this was helpful,
Regards,
Will Hartung
([EMAIL PROTECTED])
- Original Message -
From: Turoff, Steve [EMAIL PROTECTED]
To: Will Hartung [EMAIL PROTECTED]
Sent: Tuesday, January 14, 2003 10:07 AM
Subject: RE: Memory Usage and Garbage Collection
Will,
I too am experiencing memory
I know somebody answered this question before but could not find it in
the archives.
Is there any difference between -Xms64m and -Xms64M
Similarly is there a difference between -Xms1G and -Xms1g
Hari
Is there a way to find out how often tomcat runs Garbage Collection and
how to optimize it if GC does not happen often
Hari
It's not tomcat that runs the gc but the jvm.
To find out more about when the garbage collection happens,
you have to set the verbosegc option of the vm:
http://docs.sun.com/db/doc/806-1367/6jalj6mv7?a=view
http://www-106.ibm.com/developerworks/java/library/i-garbage3/
To tune the gc you can
much for your help.
Steve
-Original Message-
From: Will Hartung [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 03, 2003 4:54 PM
To: Tomcat Users List
Subject: Re: Memory Usage and Garbage Collection
From: Brandon Cruz [EMAIL PROTECTED]
Sent: Friday, January 03, 2003 2:23 PM
the outofmemory error.
saurabh
[EMAIL PROTECTED] 01/04/03 01:12AM
On Fri, 3 Jan 2003, Saurabh Arora wrote:
Date: Fri, 03 Jan 2003 02:33:17 -0700
From: Saurabh Arora [EMAIL PROTECTED]
Reply-To: Tomcat Users List [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: RE: Memory Usage and Garbage
So the instance, and it's string, can still be GC'd, right?
Nope.
There is still a live reference to each OtherObject instance sitting in
the static HashMap cache. Therefore, this instance cannot be GC'd, even
though *you* have released your own reference to it. And, if the
OtherObject class
Hi Craig,
please see intermixed.
On 2 Jan 2003 at 18:18, Craig R. McClanahan wrote:
Instances can be garbage collected IF AND ONLY IF there are no
live references to that object in a static/instance/local
variable of some other object that is also in memory. Only
instances that are no
Just wanted to know, does the current implementation of tomcat 4.1.18
also has the same problem of keeping the jsp's
in memory. or it was only present in 4.0.4
saurabh
[EMAIL PROTECTED] 01/03/03 02:26PM
Hi Craig,
please see intermixed.
On 2 Jan 2003 at 18:18, Craig R. McClanahan wrote:
Hi,
There's clearly some misconceptions on the topic of garbage collection
;) These questions come up very often it seems, on this list and
others.
Please consider the following service() or doGet() or so of a
servlet:
public void service(ServletRequest request, ServletResponse
response
Hi thank you,
your reply calms me down again. I guess I got a bit confused by
the preceding discussion.
Andreas
On 3 Jan 2003 at 8:59, Shapira, Yoav wrote:
Hi,
There's clearly some misconceptions on the topic of garbage
collection ;) These questions come up very often it seems
On Fri, 3 Jan 2003, Andreas Probst wrote:
Hi Craig,
please see intermixed.
On 2 Jan 2003 at 18:18, Craig R. McClanahan wrote:
Instances can be garbage collected IF AND ONLY IF there are no
live references to that object in a static/instance/local
variable of some other object that
On Fri, 3 Jan 2003, Saurabh Arora wrote:
Date: Fri, 03 Jan 2003 02:33:17 -0700
From: Saurabh Arora [EMAIL PROTECTED]
Reply-To: Tomcat Users List [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: RE: Memory Usage and Garbage Collection
Just wanted to know, does the current implementation
Hi Craig,
thank you very much for this complete explanation. That's
perfectly understandable and the GC-behaviour which I had
expected before. I must have understood something wrong in this
thread's discussion, which went on yesterday.
Again, thank you very much for your helpful responses
created will take up all the available RAM. Is
this correct?
Brandon
-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 03, 2003 1:43 PM
To: Tomcat Users List
Subject: RE: Memory Usage and Garbage Collection
On Fri, 3 Jan 2003, Saurabh
From: Brandon Cruz [EMAIL PROTECTED]
Sent: Friday, January 03, 2003 2:23 PM
Subject: RE: Memory Usage and Garbage Collection
1)For every single request to a servlet or JSP page, a new instance of
that
class is created? For example, if there is one JSP page and ten people
access that one
On Fri, 3 Jan 2003, Brandon Cruz wrote:
Date: Fri, 3 Jan 2003 16:23:24 -0600
From: Brandon Cruz [EMAIL PROTECTED]
Reply-To: Tomcat Users List [EMAIL PROTECTED],
[EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Subject: RE: Memory Usage and Garbage Collection
Craig,
From
: Fri, 3 Jan 2003 16:23:24 -0600
From: Brandon Cruz [EMAIL PROTECTED]
Reply-To: Tomcat Users List [EMAIL PROTECTED],
[EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Subject: RE: Memory Usage and Garbage Collection
Craig,
From what you have been saying...
1)For every single request
Instead, you'd want to use a single JSP page for each basic *style*
of output (essentially the JSP page would be a formatting template)
that pulls in the unique information for a particular report (from
the database, from XML, or whatever) dynamically.
For example, with the web site for The
There is still a live reference to each OtherObject instance sitting in
the static HashMap cache.
there is no way to ***ever*** GC this instance
Another example of a similar memory leak is the File.deleteOnExit method.
It should not be used without extreme care and understanding in a server
Do loaded jsp pages and/or class files ever get garbage collected when
tomcat is running?
We have a production server with several hundred virtual hosts per host,
each with a fair share of jsp pages and with moderate to low traffic per
host. As time goes on, the amount of memory being used
On Thu, 2 Jan 2003, Brandon Cruz wrote:
Date: Thu, 2 Jan 2003 16:16:23 -0600
From: Brandon Cruz [EMAIL PROTECTED]
Reply-To: Tomcat Users List [EMAIL PROTECTED],
[EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Subject: Memory Usage and Garbage Collection
Do loaded jsp
List; [EMAIL PROTECTED]
Subject: Re: Memory Usage and Garbage Collection
On Thu, 2 Jan 2003, Brandon Cruz wrote:
Date: Thu, 2 Jan 2003 16:16:23 -0600
From: Brandon Cruz [EMAIL PROTECTED]
Reply-To: Tomcat Users List [EMAIL PROTECTED],
[EMAIL PROTECTED]
To: Tomcat Users List [EMAIL
: Friday, January 03, 2003 1:12 AM
Subject: Re: Memory Usage and Garbage Collection
On Thu, 2 Jan 2003, Brandon Cruz wrote:
Date: Thu, 2 Jan 2003 16:16:23 -0600
From: Brandon Cruz [EMAIL PROTECTED]
Reply-To: Tomcat Users List [EMAIL PROTECTED],
[EMAIL PROTECTED]
To: Tomcat Users List
On Thu, 2 Jan 2003, Brandon Cruz wrote:
Date: Thu, 2 Jan 2003 19:04:55 -0600
From: Brandon Cruz [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: Memory Usage and Garbage Collection
Craig,
Thanks for your comments, I still have a few
On Fri, 3 Jan 2003, Julian Löffelhardt wrote:
Date: Fri, 3 Jan 2003 02:01:58 +0100
From: Julian Löffelhardt [EMAIL PROTECTED]
Reply-To: Tomcat Users List [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Subject: Re: Memory Usage and Garbage Collection
Looking at the jasper
I am using tomcat 4.1.12 with JDK 1.4.1.
I have JSP that starts a thread under tomcat. This thread seems to work
fine, but some objects ( which has valid reference ) are getting garbage
collected. I find that the finalizer thread runs through the shutdown of
this object.
But when I run it in
maybe these open connections force
some of the session scoped beans to persist? Forever? Or am I just missing something
completely about garbage collection?
So, in short, if I have a session scoped bean that has in it something like a
connection or a recordset (which is most likely not a good
Howdy,
Very few things are guaranteed regarding garbage collection when you
consider your system as a whole. The container can almost always cache
things like JSPs, servlets, and sessions until it feels like releasing
them. Some of these parameters you can control via configuration, e.g
Collection in Java: Am I an idiot?
Howdy,
Very few things are guaranteed regarding garbage collection
when you consider your system as a whole. The container can
almost always cache things like JSPs, servlets, and sessions
until it feels like releasing them. Some of these parameters
you can
On Thu, 29 Aug 2002, Michael Nicholson wrote:
Date: Thu, 29 Aug 2002 09:07:58 -0400
From: Michael Nicholson [EMAIL PROTECTED]
Reply-To: Tomcat Users List [EMAIL PROTECTED]
To: Tomcat Users List [EMAIL PROTECTED]
Subject: OT: Garbage Collection in Java: Am I an idiot?
The answer
Each time I reload my application with the Manager servlet the memory usage
increase.
Spec: I have Tomcat 4.0.2 and JDK 1.3.1_02 running on a Windows2k machine.
I have located my problem using JProbe with Tomcat 4.0.2. Looking at the
instance summary before and after a reload I see that there
: Thomas Ehlen [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 15, 2002 9:11 AM
To: Tomcat Users List
Subject: Problems with Manager reload, memory usage and garbage
collection.
Each time I reload my application with the Manager servlet
the memory usage
increase.
Spec: I have Tomcat
Hi,
-Original Message-
From: Thomas ?hlen [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 15, 2002 4:11 PM
To: Tomcat Users List
Subject: Problems with Manager reload, memory usage and garbage
collection.
Each time I reload my application with the Manager servlet
Each time I reload my application with the Manager servlet the
memory usage
increase.
Spec: I have Tomcat 4.0.2 and JDK 1.3.1_02 running on a Windows2k
machine.
I have located my problem using JProbe with Tomcat 4.0.2. Looking at the
instance summary before and after a reload I
See intermixed.
On Thu, 25 Oct 2001, Bang, Steinar wrote:
Date: Thu, 25 Oct 2001 15:55:35 +0200
From: Bang, Steinar [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: '[EMAIL PROTECTED]' [EMAIL PROTECTED]
Subject: Questions on tomcat heap usage and garbage collection (avoiding
O
See below:
-Ursprüngliche Nachricht-
Von: Bang, Steinar [mailto:[EMAIL PROTECTED]]
Gesendet: Donnerstag, 25. Oktober 2001 09:20
An: '[EMAIL PROTECTED]'
Betreff: RE: Questions on tomcat heap usage and garbage collection
(avoidi ng O utOfMemoryError exceptions)
snip/
Why does
Bang, Steinar at [EMAIL PROTECTED] wrote:
Which brings us to question 2: tuning apache/tomcat:
When reading the documentation, I thought that there
was supposed to be a single tomcat process, serving
all requests. However top reports a lot of tomcat
processes, when I'm stresstesting the
Randy Layman [mailto:[EMAIL PROTECTED]] writes:
I think the best thing you can do is to determine
where the memory is going and fix your leaks. I say
your leaks because in my experience, Tomcat doesn't
leak memory and doesn't take a lot of memory for each
connection.
I perhaps wasn't too
Craig R. McClanahan [mailto:[EMAIL PROTECTED]] writes:
The most important task in a situation like this is
to find out why memory is being consumed in the first
place. Generally, this is caused by one of the
following types of factors:
* Creating lots and lots of session attributes in
I wrote earlier:
Craig R. McClanahan [mailto:[EMAIL PROTECTED]] writes:
[snip!]
But it doesn't address my real worry at the moment:
that a script kiddie armed with nothing more than
the httperf testing tool can bring my tomcat to
crash.
and/or whether your test JSP page can temporarily
the tomcat
processes are restarted?
3. catch the exception?
4. use some kind of watchdog to restart tomcat?
Question 3 raises more questions:
3a. What do you do when you catch the exception?
There isn't much you _can_ do if you don't have
any memory left. Maybe force a garbage
[mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 24, 2001 3:21 AM
To: '[EMAIL PROTECTED]'
Subject: Questions on tomcat heap usage and garbage
collection (avoiding
O utOfMemoryError exceptions)
Platform: Intel PIII 797.499MHz, 256MB RAM
Debian Woody GNU/Linux
on tomcat heap usage and garbage
collection (avoiding
OutOfMemoryError exceptions)
Platform: Intel PIII 797.499MHz, 256MB RAM
Debian Woody GNU/Linux,
kernel 2.2.19
Blackdown J2SDK 1.3.1
apache 1.3.19
tomcat 3.2.3
: Bang, Steinar [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: '[EMAIL PROTECTED]' [EMAIL PROTECTED]
Subject: Questions on tomcat heap usage and garbage collection (avoiding
O utOfMemoryError exceptions)
Platform: Intel PIII 797.499MHz, 256MB RAM
Debian Woody GNU/Linux
76 matches
Mail list logo