Article View: borland.public.jbuilder.java.language
Article #7790Re: Garbage collecting and Singleton class's
From: Ren� F Kristiansen
Date: Mon, 14 May 2001 15:37
Date: Mon, 14 May 2001 15:37
12 lines
1394 bytes
1394 bytes
> If I have a singleton class defined like the one below will it ever be > garbage collected after getInstance has been called or will the static > reference keep the object in memory forever? NO!.. U call it like this : Singleton sg = Singleton.getInstance() so the Singleton only stays in memory as long as sg.. (-: RFK :-)
Technical Details
Message-ID:
<iXSL6.3286$h4.1171886@news101.telia.com>Path:
arc1-ca.pugleaf.net!archiver1.sj.google.com!newsfeed.google.com!sn-xit-02!supernews.com!news.tele.dk!194.255.56.67!newsfeed101.telia.com!news101.telia.com.POSTED!not-for-mailReferences:
<3ae0a428$1_2@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,b3b5ce7464e06d96 X-Google-Attributes: gidf74b3,public X-Google-ArrivalTime: 2001-05-14 08:35:43 PST Path: arc1-ca.pugleaf.net!archiver1.sj.google.com!newsfeed.google.com!sn-xit-02!supernews.com!news.tele.dk!194.255.56.67!newsfeed101.telia.com!news101.telia.com.POSTED!not-for-mail From: "Ren� F Kristiansen" <Rene_fk@stofanet.dk> Newsgroups: borland.public.jbuilder.java.language References: <3ae0a428$1_2@dnews> Subject: Re: Garbage collecting and Singleton class's Lines: 14 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2462.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2462.0000 Message-ID: <iXSL6.3286$h4.1171886@news101.telia.com> Date: Mon, 14 May 2001 17:37:41 +0200 NNTP-Posting-Host: 212.10.116.60 X-Complaints-To: abuse@stofa.dk X-Trace: news101.telia.com 989854542 212.10.116.60 (Mon, 14 May 2001 17:35:42 MEST) NNTP-Posting-Date: Mon, 14 May 2001 17:35:42 MEST Organization: Customer of Telia Stofa A/S <http://www.stofa.dk/>