🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #7446

Re: Reference Counting in Java Classes

#7446
From: Yuri Dyankov
Date: Tue, 19 Jun 2001 18:52
48 lines
2181 bytes
The question is how many references we have to a specified Java Object. The
following code illustrates the idea:


Double d1 = new Double(1.2);
{
    Double d2 = d1;
// Now we have two references to the same object.

    getRefCount(d1); // Must return 2
}
getRefCount(d1); // Must return 1



So we need a function like getRefCount(Object o)


"Yonatan Taub" <yonatanta@bashan.co.il> wrote in message
news:3b2f9a9f_1@dnews...
> I'm afraid I don't quite understand your question.
>
> I don't think you can get the reference count of an object in Java
(although
> the garbage collector monitors them).
> Perhaps it's possible to acquire the references on a remote object (RMI)
but
> that is just a guess.
>
> "Bobby B." <bobby-b@writeme.com> wrote in message news:3b2f7410_2@dnews...
> > Someone who knows how to get the reference count of a Java object?
> > Is there any way to do it?
> >
> > I'm not interested in custom made implementations. I need the Reference
> > count of the JVM for example?
> >
> >
> > --
> > Boris Hristov
> > Bravo Consulting
> > Chief Technology Officer
> > web: http://www.bravo-group.com
> > email: Boris.Hristov@bravo-group.com
> > phone: +359.88.211.322, +49.177.4244.960
> >
> >
>
>
Technical Details
Message-ID: <3b2f9fd2_1@dnews>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!newsfeed00.sul.t-online.de!t-online.de!news1.dtag.de!news.stgl.sel.alcatel.de!news.stgl.sel.alcatel.de!dnews
References: <3b2f7410_2@dnews> <3b2f9a9f_1@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,4be06569ed3cf813
X-Google-Attributes: gidf74b3,public
X-Google-ArrivalTime: 2001-06-19 12:06:35 PST
From: "Yuri Dyankov" <yuri_diankov@yahoo.com>
Newsgroups: borland.public.jbuilder.java.language
References: <3b2f7410_2@dnews> <3b2f9a9f_1@dnews>
Subject: Re: Reference Counting in Java Classes
Date: Tue, 19 Jun 2001 21:52:40 +0300
Lines: 50
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.3018.1300
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.3018.1300
NNTP-Posting-Host: 212.36.9.121
Message-ID: <3b2f9fd2_1@dnews>
X-Trace: dnews 992976850 212.36.9.121 (19 Jun 2001 11:54:10 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!newsfeed00.sul.t-online.de!t-online.de!news1.dtag.de!news.stgl.sel.alcatel.de!news.stgl.sel.alcatel.de!dnews