Hi Stephan,
v8 DOES NOT  clean up when the session exits. This is, of course, very  
annoying, but apparently is so that, if a web page with dozens of  
embedded sub-pages (in iframes) is destroyed, there won't be dozens of  
expensive garbage collections.

In short, the only way to debug it is to create tens of thousands,  
even, as Ondrej pointed out,  millions, of objects.

Or, you could try adding lines  like this:
// in pf_wrap():
// trick v8 into thinking that 4 kilobytes are being used for this  
object
V8::AdjustAmountOfExternalAllocatedMemory(1024 * 4);

// in pf_dtor():
// tell v8 we are done with that memory.
V8::AdjustAmountOfExternalAllocatedMemory(-1024 * 4);

I cover it here, in the v8 cookbook I've been working on in what  
little spare time I have:
http://create.tpsitulsa.com/wiki/V8/Garbage_Collection

Alex

On Mar 5, 2009, at 1:53 PM, Stephan Beal wrote:

>
> On Mar 5, 8:47 pm, Alex Iskander <[email protected]> wrote:
>> How many of these objects have you created, exactly? I've had to
>> create thousands before it would clear.
>
> Sorry, the demo was only 5 objects, but i was trying 1000 at some
> point. Even when my JS session exits, the dtor is never called (and i
> would expect it to finally be cleaned up when v8 exits the context, at
> the latest).
>
>> I'm still looking over the code to see if I can find anything wrong
>> with it, but there isn't anything glaring,
>
> That's comforting :).
>
> Thanks :)
>
> >

Alex Iskander, TPSi





--~--~---------~--~----~------------~-------~--~----~
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to