Article View: borland.public.jbuilder.java.language
Article #8145Re: Garbage collecting and Singleton class's
From: John McGrath TeamB
Date: Sat, 21 Apr 2001 03:36
Date: Sat, 21 Apr 2001 03:36
18 lines
1497 bytes
1497 bytes
On Fri, 20 Apr 2001 15:01:57 -0600, Calvin R. Smith wrote:
> 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?
The static reference will keep it alive. You can set the reference to
null, which will make it available for garbage collection. It may or
may not actually be finalized and garbage collected after that.
--
Regards,
John McGrath [TeamB]
---------------------------------------------------
Before sending me e-mail, please read:
http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID:
<MPG.154ac219901cf62d98a13f@forums.borland.com>Path:
arc1-ca.pugleaf.net!newsfeed.google.com!sn-xit-03!supernews.com!newsswitch.lcs.mit.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnewsReferences:
<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-04-20 20:44:01 PST From: John McGrath [TeamB] <ng-b@JPMcGrath.net> Newsgroups: borland.public.jbuilder.java.language Subject: Re: Garbage collecting and Singleton class's Date: Fri, 20 Apr 2001 23:36:04 -0400 Message-ID: <MPG.154ac219901cf62d98a13f@forums.borland.com> References: <3ae0a428$1_2@dnews> X-Newsreader: MicroPlanet Gravity v2.30 NNTP-Posting-Host: 209.92.40.60 X-Trace: dnews 987824163 209.92.40.60 (20 Apr 2001 20:36:03 -0700) Lines: 18 X-Authenticated-User: jpmcgrath Path: arc1-ca.pugleaf.net!newsfeed.google.com!sn-xit-03!supernews.com!newsswitch.lcs.mit.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews