00:00:19  <joshthecoder>So got a question about how V8 collects objects. Say I have this object graph: https://gist.github.com/0bcc06581e4c57039654
00:00:29  <joshthecoder>Would object B be collectable by the GC at this point?
00:00:48  <joshthecoder>I seem to be running into a case where B is getting collected on me.
00:01:28  <joshthecoder>Well I guess the thing that puzzles me is if the weak callback will occur before the GC collects B.
00:01:33  <bnoordhuis_>joshthecoder: if A is weak, A gets collected. B has nothing pointing to it so it gets collected as well
00:02:02  <joshthecoder>bnoordhuis_: yeah that's what I figure. So I am confused why B seems to be getting lost.
00:02:31  <bnoordhuis_>lost?
00:03:12  <joshthecoder>B also has a weak callback. That seems to be getting called before A's.
00:04:51  <bnoordhuis_>joshthecoder: are you reviving either A or B? if not, everything is working as expected
00:05:07  <joshthecoder>bnoordhuis_: A should get revived in the weak callback.
00:05:19  <joshthecoder>ClearWeak() should make that handle strong again right?
00:05:58  <joshthecoder>I also call MarkIndependent() on each handle to improve GC performance. Otherwise V8 seems to only collect them during global GC.
00:06:22  <bnoordhuis_>i think you need to call MakeWeak() again in order to revive it
00:06:45  <bnoordhuis_>in your WeakCallback at least
00:07:42  <joshthecoder>bnoordhuis_: hmmm. Will that alone make the handle strong again or will the callback get called again.
00:08:20  <joshthecoder>It's odd this seems to work fine most of the time. Just running into an odd edge case.
00:08:33  <bnoordhuis_>no, it remains weak. i think you need to call ClearWeak() outside the gc
00:17:36  <joshthecoder>bnoordhuis_: thanks
00:39:34  * bnoordhuis_quit (Ping timeout: 240 seconds)
01:22:41  * joshthecoderquit (Quit: Leaving...)
01:45:02  * C-Manquit (Quit: Connection reset by beer)
02:40:13  * lohkeypart
03:16:07  * joshthecoderjoined
04:33:40  * joshthecoderquit (Remote host closed the connection)
04:33:53  * joshthecoderjoined
05:07:31  * joshthecoderquit (Read error: Connection reset by peer)
05:07:48  * joshthecoderjoined
06:01:02  * lohkeyjoined
07:03:27  * lllk^joined
07:05:17  * lllk^quit (Client Quit)
07:06:13  * rendarjoined
07:27:22  * lohkeyquit (Read error: Connection reset by peer)
08:10:58  * [[zzz]]joined
08:14:22  * [[zz]]quit (Ping timeout: 244 seconds)
08:29:21  * eoh|quit (Read error: Connection reset by peer)
08:29:27  * eohjoined
08:36:56  * [[zzz]]changed nick to [[zz]]
08:50:04  * nierobjoined
09:01:09  * joshthecoderquit (Quit: Linkinus - http://linkinus.com)
09:11:03  * TheJHjoined
09:26:57  * C-Manjoined
10:18:36  * TheJHquit (Ping timeout: 240 seconds)
11:44:07  * TheJHjoined
12:11:31  * bnoordhuisjoined
13:12:36  * eohquit (Read error: Connection reset by peer)
13:13:01  * eohjoined
13:19:29  * TheJH_joined
13:22:58  * TheJHquit (Ping timeout: 246 seconds)
14:17:10  * Net147joined
15:02:34  * Net147quit (Quit: HydraIRC -> http://www.hydrairc.com <- Now with extra fish!)
15:43:09  * RT|Chatzillaquit (Quit: ChatZilla 0.9.86.1 [Firefox 2.0.0.22pre/2009081014])
16:22:30  * joshthecoderjoined
17:12:34  * eohquit (Read error: Connection reset by peer)
17:12:48  * eohjoined
17:34:23  * eoh|joined
17:34:46  * eohquit (Read error: Connection reset by peer)
18:06:26  * bnoordhuisquit (Ping timeout: 260 seconds)
18:27:39  * eoh|quit (Read error: Connection reset by peer)
18:38:28  * lohkeyjoined
19:16:19  * recyclejoined
19:28:36  * lohkeyquit (Quit: lohkey)
19:38:00  * lohkeyjoined
20:02:22  * _lohkeyjoined
20:02:33  * _lohkeyquit (Client Quit)
20:02:39  * lohkeypart
20:03:02  * _lohkeyjoined
20:06:49  * _lohkeyquit (Client Quit)
20:06:58  * lohkeyjoined
21:37:20  * joshthecoderquit (Remote host closed the connection)
21:37:31  * joshthecoderjoined
22:03:00  * joshthecoderquit (Read error: Connection reset by peer)
22:03:14  * joshthecoderjoined
22:18:45  * rendarquit
22:31:37  * RT|Chatzillajoined
23:29:43  * duckinatorquit (*.net *.split)
23:31:52  * duckinatorjoined