class gc
Per Bothner
bothner@cygnus.com
Fri Feb 26 19:34:00 GMT 1999
> I'm not sure how adding a flag to the class would help since I do not
> know whether a given reference actually points to a java.lang.Class object.
I don't remember the details, but the Boehm collector has a way to
register objects with the GC. So what you do is register all the
statically allocated Classes with the GC on start-up.
Actually, I don't see any need to register a Class with the GC; what we
really need to do is register any static reference fields as global roots.
This is for statically-allocated Classes; dynamically allocated
classes are of course allocated by the GC.
As I said, I don't know the specifics, but this is a well understood
problem.
--Per Bothner
Cygnus Solutions bothner@cygnus.com http://www.cygnus.com/~bothner
More information about the Java
mailing list