Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Tracking memory references in Rhino

1 view
Skip to first unread message

Alexander Stockinger

unread,
Oct 28, 2006, 6:24:48 AM10/28/06
to
Hello,

is there a way to track referenced objects in scripts? I have scopes
that run for a long time working on an increasing number of objects but
releasing the references underway - and need to know about it since
there are critical resources attached to these objects. So is there a
way to know that a object isn't referenced by the JS code anymore?

Thanks for your help,
Alex

Cameron McCormack

unread,
Oct 29, 2006, 5:19:14 PM10/29/06
to
Hi Alex.

What about using a WeakReference and an associated ReferenceQueue from
your Java code to be notified when the object has become only weakly
reachable?

http://java.sun.com/j2se/1.5.0/docs/api/java/lang/ref/WeakReference.html

Cameron

--
Cameron McCormack, http://mcc.id.au/
xmpp:hey...@jabber.org ▪ ICQ 26955922 ▪ MSN c...@mcc.id.au

0 new messages