commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "J.Pietschmann" <j3322...@yahoo.de>
Subject Re: [math] design patterns (was Re: cvs commit: jakarta-commons-sandbox/math/src/java/org/apache/commons/math/stat UnivariateImpl.java)
Date Fri, 04 Jul 2003 18:58:38 GMT
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: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message