JavaMemoryModel: Are 'final' fields cause the GC to be more efficient?

From: Doron Rajwan (doron@rajwan.org)
Date: Sun Apr 24 2005 - 08:04:22 EDT


In generational GC, the hardest problem, as I
understand, is that "old" objects can reference "new"
objects. Thus, when we want to GC some new generation,
the GC needs to scan the old generations as well, to
find such references.

However, if some class has only 'final' fields, there
is no need to scan it, since it cannot reference the
"new" objects. So, the GC needs to scan only objects
of classes with non-final reference fields.

Is this true?

thanks,
  Doron.

-------------------------------
JavaMemoryModel mailing list - http://www.cs.umd.edu/~pugh/java/memoryModel



This archive was generated by hypermail 2b29 : Thu Oct 13 2005 - 07:01:09 EDT