Article View: borland.public.jbuilder.java.language
Article #14736Re: Circular references and garbage collecting
From: Steve Horsley
Date: Thu, 05 Aug 1999 00:00
Date: Thu, 05 Aug 1999 00:00
37 lines
1587 bytes
1587 bytes
Yes it can. Any mesh of cross-referencing objects becomes
eligible for garbage collection as soon as the last reference to
them becomes lost to the running prog.
For instance, if you nullify a reference to the end of a double-
linked list, the whole list is eligible.
Circular references is one of the problems the gc writers
had to deal with.
Sun has some articles on garbage collection at their site
http://java.sun.com/
Steve.
//-------------------------------------
Mika Ylikangas wrote:
>
> Hi!
>
> Is following a problem with Java- language?
>
> class Parent {
> Vector of Child;
> }
>
> class Child {
> Parent parent;
> }
>
> When the reference to Parent-object is lost from the client, the Parent
> should be garbage collected, but in the Child- objects there are references
> to Parent. So, can Java's garbage collector handle this kind of situation?
> If not, then what is the best way to deal with it?
>
> Any ideas are welcome
> Mika Ylikangas
Technical Details
Message-ID:
<37A9B19C.87EE085E@cwcom.co.uk>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<01bedf4a$c23c2c90$d9c6a5c3@PPC23>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,3f24176e9efa3a85 X-Google-Attributes: gidf74b3,public From: Steve Horsley <steve.horsley@cwcom.co.uk> Subject: Re: Circular references and garbage collecting Date: 1999/08/05 Message-ID: <37A9B19C.87EE085E@cwcom.co.uk> X-Deja-AN: 509220819 Content-Transfer-Encoding: 7bit References: <01bedf4a$c23c2c90$d9c6a5c3@PPC23> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: Cable & Wireless Communications Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language