The Artima Developer Community
Sponsored Link

Probably

Advertisement

Advertisement

This page contains an archived post to the Design Forum (formerly called the Flexible Java Forum) made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Probably

Posted by Bill Venners on 19 May 1998, 8:20 AM

Richard,

> From the book excerpt...

> So in principle, if I don't define finalize() methods in my code, the GC will run faster over my objects because it will only have to do a Phase I pass and can skip the Phase II pass?

> Oh, but as I can make no assumptions about the GC, I suppose there's little point loosing sleep over this.

Yeah, most likely GC will be less work for a JVM the less objects
have finalizers, so finalization should consume less CPU time
and maybe memory space compared to finalization on the same
JVM with more finalizers. But there's no guarantee across JVM
implementations.

Since there aren't that many situations in which people will
likely need to declare finalizers, there's not much call to try
and eliminate finalizers to help performance.

bv




Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us