"Scott C. Tavares" wrote:
>
> ----- Original Message -----
> From: Kevin A. Burton <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, March 24, 2000 7:27 PM
> Subject: JDK 1.1 Garbage Collects all singletons.
>
> <snip>
> >
> > Basically singletons don't work. Both VMs will GC static members right
> > after there are no references. For Servlet code that can happen very
> > quickly. With finalize methods you can clearly see this happening.
> >
> > Everythign works just fine with the Singleton. But when the you access
> > the Singleton again it is re-instantiated for you by the VM. Totally
> > getting rid of the advantage of a singleton.
> >
>
> I always thought the purpose of a Singleton is not so much to stay cached in
> memory but to disallow multiple instances of its-self to ever be
> instantiated at any point in time. What this buys you is that, say you have
> multiple concurrent users all using trying to use the same object, the
> Singleton pattern will make sure that they all share the same instance
> instead of a new instance for each user. Does this make since or am I way
> off here?
Under JDK 1.1 this works as long as multiple people are hitting it. But
the second the traffic slows down the object gets collected Q#%$##@!!!!
Under JDK 1.2 static references are kept.
This kills me for Jetspeed. The site generation takes a long time and
will kill performance if this gets collected.
--
Kevin A Burton ([EMAIL PROTECTED])
http://relativity.yi.org
Message to SUN: "Please Open Source Java!"
"For evil to win is for good men to do nothing."
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]