File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Performance and the fly likes about garbage collection logs 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 "about garbage collection logs" Watch "about garbage collection logs" New topic

about garbage collection logs

trupti nigam
Ranch Hand

Joined: Jun 21, 2001
Posts: 614
Hello All,

I am not sure if this is the right group to post my question.

In my applications garbage collection logs, I see below line.

2013-11-26T10:35:45.050-0500: 5195.298: [GC 5195.298: [DefNew: 17430K->456K(19136K), 0.0102408 secs] 796185K->779211K(2668480K), 0.0103687 secs] [Times: user=0.01 sys=0.00, real=0.01 secs]
2013-11-26T10:36:10.593-0500: 5220.840: [GC 5220.840: [DefNew: 17480K->398K(19136K), 0.0100548 secs] 796235K->779153K(2668480K), 0.0101835 secs]

The last line seems half cut. Does that indicate that there is memory leak in my application? I have not seen the app throwing the out of memory error.

Please help.

trupti nigam
Ranch Hand

Joined: Jun 21, 2001
Posts: 614
no updates? IS this the right forum to ask Garbage collection related questions?
Martin Vajsar

Joined: Aug 22, 2010
Posts: 3733

Well, yes, this is the right forum.

I'm pretty sure that this is not an indication of a memory leak. The problem with memory leak is that the GC is not able to detect it. This is an intrinsic property of a memory leak - it is memory which is not used, but the GC cannot determine that the memory is not used. I'd say that if the GC could detect a memory leak, it could do something about it - either log the message much more prominently, or just reclaim the leaked memory outright.

If you're able to run your application for a long time without memory errors, you probably don't have a memory leak. You could have a memory leak which is constant in size (say, you keep a reference to a "big" object in a unused global variable somewhere), but since such memory leaks don't cause memory to run out, they are much less harmful that memory leaks which get bigger with time.
Winston Gutkowski

Joined: Mar 17, 2011
Posts: 8946

trupti nigam wrote:The last line seems half cut. Does that indicate that there is memory leak in my application?

Fraid not. It could be something as simple as the fact that the reader is buffered, and that the last block is incomplete.

A simple flush() might correct it - or it might not - but at least you'll be sure that you read everything in the file.


Bats fly at night, 'cause they aren't we. And if we tried, we'd hit a tree -- Ogden Nash (or should've been).
Articles by Winston can be found here
Luan Cestari
Ranch Hand

Joined: Feb 07, 2010
Posts: 163

I agree with Martin and Winston. I also think that could be just some internal code in the JVM that printed that way for some undocumented reason (like, maybe it couldn't get the system call measures in that time)

Please, visit me for some cool tech post at
I agree. Here's the link:
subject: about garbage collection logs
It's not a secret anymore!