In Chromium we have additional check points that check memory usage
and trigger GC if it's too high.  Take a look at:
http://www.google.com/codesearch/p?hl=ru#oNZLX4WuLx8/trunk/WebKit/WebCore/bindings/v8/V8GCController.cpp&q=v8gccontroller::checkmemoryusage&sa=N&cd=1&ct=rc

This is not the most beatiful piece of code, but it helps with some
rather nasty bugs.

However, before implementing that, why do you need to depend on amout
of externally allocated memory?  The principal reason for Chromium is
the case when JS wrappers retain huge natively allocated structures
(esp. when wrappers are thin by themselves).  Is it the case for you
or you have some different story?

yours,
anton.

On Fri, May 7, 2010 at 3:29 AM, Eddy Bruël <[email protected]> wrote:
> Hey,
> As far as I know, the v8 garbage collection heuristics are *not* affected by
> memory allocations done by external libraries. That's exactly what
> AdjustAmountOfExternalAllocatedMemory is for.
>
> On Thu, May 6, 2010 at 11:59 PM, Camilo Aguilar <[email protected]>
> wrote:
>>
>> Sorry for my insistence, I'm trying to understand :$.
>>
>> On Thu, May 6, 2010 at 5:54 PM, Camilo Aguilar <[email protected]>
>> wrote:
>>>
>>> Thank you for your quick answers but what happens if I have a library
>>> like libxml, gnutls, c-ares, libvirt, etc. They have theirs own internal
>>> memory allocations and deallocations. Does this affect the v8 garbage
>>> collection heuristics?
>>> I need to hack each library that I want to use through Javascript to add
>>> AdjustAmountOfExternalAllocatedMemory in everyone of them?
>>>
>>> Camilo
>>>
>>> 2010/5/6 Søren Gjesse <[email protected]>
>>>>
>>>> Take a look at the API AdjustAmountOfExternalAllocatedMemory in
>>>> include/v8.h, I think that is what you are looking at.
>>>> Regards,
>>>> Søren
>>>>
>>>> On Thu, May 6, 2010 at 23:09, Camilo Aguilar <[email protected]>
>>>> wrote:
>>>>>
>>>>> I'm currently porting a C Library to Nodejs using de v8 C++ API and I
>>>>> have a big question:
>>>>>
>>>>> Are the garbage collection heuristics affected due to memory
>>>>> allocations and deallocations inside this C Library ?
>>>>>
>>>>> If so, how can I let it to know of these allocations/deallocations ?
>>>>>
>>>>> Camilo Aguilar
>>>>>
>>>>> --
>>>>> 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
>>
>> --
>> 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

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

Reply via email to