Hi Charles,
D8 has support for finding backreferences, you can learn how it's
implemented. Consider this sample D8 session:
$ scons d8
$ ./d8 --debugger
V8 version 3.3.3 (candidate) [console: dumb]
JavaScript debugger enabled
d8> var a = {}
d8> function B(x) { this.x = x }
d8> var b = new B(a)
d8> debugger
break in [anonymous](), (d8) line 1 column 1
debugger
^
dbg> dir a
#8#, type: object, constructor #9#, __proto__ #4#, 0 properties.
dbg> references #8#
found 2 objects
#37#, type: object, constructor #39#, __proto__ #3#, 45 properties.
#38#, type: object, constructor #70#, __proto__ #80#, 1 properties.
dbg> dir #38#
#38#, type: object, constructor #70#, __proto__ #80#, 1 properties.
x: object #8#
dbg> dir #70#
#70#, type: object, constructor #10#, __proto__ #11#, 5 properties.
arguments: null #5#
length: number #14#
name: string #179#
prototype: object #80#
caller: null #5#
dbg> dir #179#
type: string, "B"
On Mon, May 2, 2011 at 23:38, Charles Lowell <[email protected]> wrote:
> Hi,
>
> Is there an easy facility for finding out how many strong references a
> particular object has, and from which objects they originate? I've got
> a memory leak caused by a WeakReferenceCallback that never gets
> invoked. I presume this is because something, somewhere is holding a
> reference to it, but I'm having difficulty pinning down who or what
> that somebody is.
>
> I've exhausted the possibilities reasoning about it, and so I'm
> looking for some way to just get empirical data. Thoughts?
>
> cheers,
> Charles
>
> --
> v8-users mailing list
> [email protected]
> http://groups.google.com/group/v8-users
>
--
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users