> From: Leon Rosenberg [mailto:[EMAIL PROTECTED]
> Subject: Re: PermGen space [ot]
>
> but if the factory is a pure static utility, calling
> ASingleton myCopy = ASingletonFactory.getASingleton();
> will leave no references to the factory class :-)
Unless the factory
On 2/16/07, Caldarale, Charles R <[EMAIL PROTECTED]> wrote:
> From: Leon Rosenberg [mailto:[EMAIL PROTECTED]
> As soon as the factory class is released nothing references
> the singleton impl object and it can be released.
Agreed - the trick is avoiding the direct reference to the factory
class.
> From: Leon Rosenberg [mailto:[EMAIL PROTECTED]
> Subject: Re: PermGen space [ot]
>
> But as long as the factory itself isn't linked by an attribute which
> is inside the impl, the factory class can be released.
Not if there's a direct reference to the factory class
.5 i actually experienced oome on redeploy with code
without any issues mentioned by your article. After we removed
singleton dependency it went away.
regards
Leon
On 2/16/07, Caldarale, Charles R <[EMAIL PROTECTED]> wrote:
> From: Leon Rosenberg [mailto:[EMAIL PROTECTED]
> Subjec
> From: Leon Rosenberg [mailto:[EMAIL PROTECTED]
> Subject: Re: PermGen space [ot]
>
> public class ASingletonFactory{
> private static ASingletonImpl instance = new ASingletonImpl();
> public static AsingletonImpl getInstance(){
>return instance;
>
uses and a better explanation of the
problem.
Cheers.
Mike.
-Original Message-
From: Leon Rosenberg [mailto:[EMAIL PROTECTED]
Sent: 16 February 2007 16:40
To: Tomcat Users List
Subject: Re: PermGen space [ot]
separate the singleton itself and the factory.
in the previous example:
pu
separate the singleton itself and the factory.
in the previous example:
public class ASingletonFactory{
private static ASingletonImpl instance = new ASingletonImpl();
public static AsingletonImpl getInstance(){
return instance;
}
}
public class ASingletonImpl{
ASingletonImpl()
So how should one write their singleton?
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- -
- Jason Pyeron PD Inc. http://www.pdinc.us -
- Sr. Consultant10 West 24th Street #