Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2006

Tip: Looking for answers? Try searching our database.

Getting GC output in Tomcat

Thread view: 
Gugle - 13 Dec 2006 14:21 GMT
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??
Andrew Thompson - 13 Dec 2006 15:04 GMT
...
> I want to get Garbage collector ouput in Tomcat 5.x.

Why?  Do you suspect an application has a
memory leak?

Andrew T.
Gugle - 14 Dec 2006 04:03 GMT
Yes...I keep getting OutOfMemoryException...wud like to c how often the
gc is running..

> ...
> > I want to get Garbage collector ouput in Tomcat 5.x.
[quoted text clipped - 3 lines]
>
> Andrew T.
Andrew Thompson - 14 Dec 2006 09:15 GMT
Please refrain from top-posting.  I find it most confusing.

> > ...
> > > I want to get Garbage collector ouput in Tomcat 5.x.
> >
> > Why?  Do you suspect an application has a
> > memory leak?
...
> 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.
Gugle - 14 Dec 2006 10:50 GMT
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..
Andrew Thompson - 14 Dec 2006 11:30 GMT
....
> 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
[quoted text clipped - 4 lines]
> 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.
Daniel Dyer - 14 Dec 2006 11:40 GMT
> Hi Andrew,
> Yes. I do know that calling GC will not help. But I'm facing a weird
[quoted text clipped - 7 lines]
>
> 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.

Signature

Daniel Dyer
http://www.uncommons.org

Gugle - 14 Dec 2006 13:36 GMT
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
Daniel Dyer - 14 Dec 2006 14:08 GMT
> 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.

Signature

Daniel Dyer
http://www.uncommons.org

vladimirkondratyev@yahoo.com - 15 Dec 2006 10:37 GMT
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
Juha Laiho - 17 Dec 2006 20:22 GMT
"Gugle" <gugle.rulez@gmail.com> 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.
Signature

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)

Gugle - 18 Dec 2006 04:00 GMT
Thanx Juha!

> "Gugle" <gugle.rulez@gmail.com> said:
> >Hi all,
[quoted text clipped - 10 lines]
>          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)


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.