Getting GC output in Tomcat

G

Gugle

Hi all,
I want to get Garbage collector ouput in Tomcat 5.x. Can someone
explain how to get this going?
I tried using "-verbose:gc" in CATALINA_OPTS. But it doesn't seem to
work. Any ideas??
 
G

Gugle

Yes...I keep getting OutOfMemoryException...wud like to c how often the
gc is running..
 
A

Andrew Thompson

Gugle wrote:

Please refrain from top-posting. I find it most confusing.
....
Yes...I keep getting OutOfMemoryException...

Note that calling GC will *not* *fix* a memory leak.

I feel the time is better spent finding the source of
the memory leak, than worrying about when Tomcat
is calling the (largely pointless) GC.

What sorts of things is the server doing (accessing D/B,
image editing etc.)?

How fast does the problem manifest? Does it take
101 days to hit 'max memory' and crash, or is it
crashing every couple of hours?

Andrew T.
 
G

Gugle

Hi Andrew,
Yes. I do know that calling GC will not help. But I'm facing a weird
problem..The same app is being run on two systems and the same requests
are made on both the systems....the amt of data handled is also the
same in both...for e.g., if I'm sending the same 100 requests to both
the servers, all 100 go through in one but the other crashes in between
complaining of outOfMemoryException...both the systems have the same
memory settings...so I was wondering if there is some problem with the
GC on the crashing system...

thanks for your help..
 
A

Andrew Thompson

Gugle wrote:
.....
Yes. I do know that calling GC will not help. But I'm facing a weird
problem..The same app is being run on two systems and the same requests
are made on both the systems....the amt of data handled is also the
same in both...for e.g., if I'm sending the same 100 requests to both
the servers, all 100 go through in one but the other crashes in between
complaining of outOfMemoryException...both the systems have the same
memory settings...so I was wondering if there is some problem with the
GC on the crashing system...

That seems like a much better description from
which to start, but it now tells me I am beyond
my area of expertise.

It might also be relevant/helpful to add the Java
versions and Tomcat versions on both systems,
and a little more detail of the 'requests' and their
responses.

E.G. what is the format of the data being passed around?
(Strings/form data, images, 3D models..?)
What is the processing that is done (D/B requests,
image translation and resizing, delivering a model as
data to an application?).

Andrew T.
 
D

Daniel Dyer

Hi Andrew,
Yes. I do know that calling GC will not help. But I'm facing a weird
problem..The same app is being run on two systems and the same requests
are made on both the systems....the amt of data handled is also the
same in both...for e.g., if I'm sending the same 100 requests to both
the servers, all 100 go through in one but the other crashes in between
complaining of outOfMemoryException...both the systems have the same
memory settings...so I was wondering if there is some problem with the
GC on the crashing system...

thanks for your help..

Get a profiler and find out what kind of objects are occupying all that
memory and where they are created.

Eclipse and NetBeans have free profilers, or you could get a trial version
of a commercial product (such as JProfiler, JProbe or YourKit).

Dan.
 
G

Gugle

Hello all,
I've used the Eclipse profiler and confirmed that there is no memory
leak...because it is running perfectly fine in one system....the app
gets HTTP requests for data over a period of time....the data is in
files which have a proprietary format(no database used)...and the data
is returned as graphs/tables etc...

Version of Java is 1.4.2.11 and tomcat version is 5.0.028
 
D

Daniel Dyer

Hello all,
I've used the Eclipse profiler and confirmed that there is no memory
leak...because it is running perfectly fine in one system....

Did you profile it while it was running on the system that it has been
failing on? Profiling it on the other system wouldn't be helpful because
you need to reproduce the problem while the profiler is attached. Finding
out what is filling up the heap should help identify the cause of the
problem. There is presumably some subtle difference between the two
systems that is triggering this behaviour. It could be a bug in your
application, or a bug in Tomcat.

Dan.
 
V

vladimirkondratyev

YourKit Java Profiler http://www.yourkit.com shows graph of GC
activity: number of invocations, invocations per second (minor and
major collections), number of invocations in last minute, etc.

BR, Vladimir
 
J

Juha Laiho

Gugle said:
Hi all,
I want to get Garbage collector ouput in Tomcat 5.x. Can someone
explain how to get this going?
I tried using "-verbose:gc" in CATALINA_OPTS. But it doesn't seem to
work. Any ideas??

Depending on your JVM version, you can log the gc output to a separate file:
"-Xloggc:filename" among the JVM startup options is your friend.
 
G

Gugle

Thanx Juha!


Juha said:
Depending on your JVM version, you can log the gc output to a separate file:
"-Xloggc:filename" among the JVM startup options is your friend.
--
Wolf a.k.a. Juha Laiho Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top