File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Performance and the fly likes monitoring GC Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Performance
Bookmark "monitoring GC" Watch "monitoring GC" New topic

monitoring GC

Annekee Dufour
Ranch Hand

Joined: Nov 04, 2003
Posts: 41
I have some applications running with java 1.4.2, and use all kinds of fashionable garbage collection monitoring options there.
But now I have this other application that really needs jdk 1.3.1, and all I can find is verbose:gc. It shows how much time the garbage collection takes and how much garbage gets collected, but it does not even give me a timestamp. There must be more! Anyone?
Jeffrey Spaulding
Ranch Hand

Joined: Jan 15, 2004
Posts: 149
i don't know if this one
already exists in 1.3.x,
in 1.4.x it gives you something like

Annekee Dufour
Ranch Hand

Joined: Nov 04, 2003
Posts: 41
It doesn't exist, that's my problem!
Billybob Marshall
Ranch Hand

Joined: Jan 27, 2004
Posts: 202
Why in the world should your app care WHEN garbage collection occurs, or how frequently, or how much it collects at a time, etc etc etc? This should not be an application requirement.
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24199

You could pipe the log through another process that added a timestamp to each line; here's one in Perl (don't laugh, I'm not much of a Perl hacker

This reads standard input and prints every line it reads preceded by a POSIX date string.

[Jess in Action][AskingGoodQuestions]
Annekee Dufour
Ranch Hand

Joined: Nov 04, 2003
Posts: 41
Thanx Ernest.
BillyBob, I sometimes see full GCs that take 7 seconds. This is harming my response times (which need to be below 2 seconds). I want to see how often that occurs. I also want to know the percentage of time my system spends garbage collecting. Maybe some tuning is necessary, increase memory or change how it is divided between young space, eden etc, another kind of garbage collection.
It is sorta covered in the JavaRanch Style Guide.
subject: monitoring GC
It's not a secret anymore!