Sorry, from the right account.

On Mon, Nov 30, 2009 at 8:39 PM, Anton Muhin <[email protected]> wrote:
> On Mon, Nov 30, 2009 at 8:20 PM, Stephan Beal <[email protected]> wrote:
>> On Mon, Nov 30, 2009 at 5:33 PM, Anton Muhin <[email protected]> wrote:
>>>
>>> You can always maintain your own list of objects that need to be
>>> destructed and destruct them when you need it.
>>
>> That's my point - i've got to do the extra work because v8 won't offer a
>> single RunGC() function which i can call before my app exits.
>>
>>>
>>> Or you could just force GC several times yourself (e.g. invoke
>>> V8::IdleNotification many times, many > 10).
>>
>> Like all other v8 GC-related hacks, it is just that - a hack.
>>
>>>
>>> Chrome is one of most important V8 client.  However, I think it's a
>>> very false assumption to think that it's the only client V8 team cares
>>> about: if you could suggest a patch which would help any other client,
>>
>> Give us a RunGC() function which actually does a full GC run, and i'll be
>> happy. Until v8 gives us a way to force GC to run from client code
>> (regardless of what the hell Chrome wants), i'll be bitching about moaning
>> about this point. This is particularly problematic for those of use who
>> write LIBRARY extensions to chrome, as opposed to APP extensions, as we
>> librarians cannot force any application to add a particular sequence of
>> calls to their apps to clean up "errant objects" which Chrome - er... v8 -
>> refused to clean up for us.
>
> Just send a patch which adds such a function---chances are it'd be
> accepted.  If not, you can easily have it in your private build.
>
> A word of caution: running a full GC once doesn't guarantee that all
> the weak references would be released for various reasons, believe me
> none of them is due to make Chrome faster.  The rule of thumb for now
> is to force at least 5 GCs which should collect all the garbage (the
> constant most probably would be reduced later).
>
> BTW, IdleNotification might be still your best bet: there are plans to
> put more and more code which would (eventually) clean all the memory
> V8 holds.
>
> And the last note.  If everything you want, is to call all weak
> callbacks, it could be easily added (just traverse all global handles
> and invoke callback on it).  But it might put your objects into a
> weird state (they are still reachable, but callback has been called on
> them).   Actually, you could probably add something like that into
> global handles teardown method, but you should be careful not to call
> into V8 from the callbacks.
>
> yours,
> anton.
>
>> --
>> ----- stephan beal
>> http://wanderinghorse.net/home/stephan/
>>
>> --
>> 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

Reply via email to