Hi Xiang I've read the discussion, however there was explicit mention of it in the ChangeLog, hence my inquiry.
It's something I would think to be important and useful. I also have Lua bindings for my code, and it can guarantee cleanup when I destroy the interpreter's state. On Mon, Nov 30, 2009 at 8:41 PM, Xiang Zhong <[email protected]> wrote: > Hi, Abdulla, > > > Currently, v8 can't do that for you. v8 can't guarantee all your destrutors > be called even when you exit the program. > If you want that, you have to manage the heap resource yourself. > > v8 do that because GC is very expensive operation and v8 don't want to > slowdown chrome when closing a tab. > > > There are plenty of discussion about GC before. > > > > > > On Mon, Nov 30, 2009 at 4:17 PM, Abdulla Kamar <[email protected]>wrote: > >> Hi Xiang >> >> I've had a look through that thread before. I'll try >> SetResourceConstraints(), but that seems like a hack to me, especially since >> I can't change it after the VM has been initialised. What I really need is a >> way to destroy all weak references when I've disposed the context. >> >> >> On Mon, Nov 30, 2009 at 6:39 PM, Xiang <[email protected]> wrote: >> >>> Hi, Abdulla, >>> >>> >>> To make sure your weak handle callback is called, you have to create >>> lots of objects. As GC will only clean necessary space based on its >>> heuristic rules, not all garbages. >>> >>> You can use API SetResourceConstraints() to constraint the heap >>> resource . It will make it easier to trigger GC(there is a test case >>> in cctest). >>> >>> There is a also sample about weak handle callback in >>> >>> http://groups.google.com/group/v8-users/browse_thread/thread/9effc94911772167/f4806a7e28d6c9f7?lnk=gst&q=Jacob#f4806a7e28d6c9f7 >>> >>> You will find it useful. >>> >>> >>> Cheers~ >>> Xiang >>> >>> >>> >>> >>> On Nov 30, 2:16 pm, Abdulla Kamar <[email protected]> wrote: >>> > Hi Xiang >>> > >>> > I've tried that, but it still doesn't destroy the weak references. >>> > >>> > >>> > >>> > >>> > >>> > On Mon, Nov 30, 2009 at 3:49 PM, Xiang <[email protected]> wrote: >>> > > Hi, Abdulla, >>> > >>> > > GC will be triggered when a new context is created(You can find it >>> > > when you try to trace Context::New()). >>> > >>> > > It used some heuristic method for better performance. >>> > >>> > > Cheers~ >>> > > Xiang >>> > >>> > > On Nov 30, 7:45 am, Abdulla <[email protected]> wrote: >>> > > > According to the ChangeLog for version 1.0.3, garbage collection is >>> > > > forced when disposing contexts, but I can't seem to trigger it in >>> > > > order to destroy weak references. Am I doing something wrong? >>> > >>> > > -- >>> > > v8-users mailing list >>> > > [email protected] >>> > >http://groups.google.com/group/v8-users >>> > >>> > -- >>> > Thank you >>> > Abdulla >>> >>> -- >>> v8-users mailing list >>> [email protected] >>> http://groups.google.com/group/v8-users >>> >> >> >> >> -- >> Thank you >> Abdulla >> >> -- >> 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 > -- Thank you Abdulla -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users
