Mark R. Diggory wrote:
Yes it is clearer, just for reference, my GC discussion at the beginning of this thread involved an article I read awhile back, this article suggested that objects that are created within a "static" method can get "stronger references" (or something along these lines) than their non-static counterparts and as such never actually get garbage collected over the life of the JVM.

There are no stronger references than ordinary references. Except perhaps j.l.r.PhantomReference (somebody out there who knows what's this actually good for?) There are weaker references though.

Perhaps it was meant said objects were referenced by static data,
in which case they of course wont be GCd. Unless the object refers
to further, perhaps continually growing data structures, this
shouldn't cause problems even in a long running server.

There are of course several other arguments against static methods
and especially against using static data: enterprise java beans
can't have static methods at all, and static data can easily become
a headache in multithreaded environments.

J.Pietschmann


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to