Caching... it can be answer to my question.

For clarification:
In intensive creating string or non-smi values for example via calling
v8::String:New , actual string value cached first and then when i'm create
persistent handle - this handle reference cached string object. Once this
caching object will be freed, - all persistent weak handles also must be
freed? But actually there is can happens very later.

For me it is ok do not create persistent handles at all for primitive and
strings, i think.

Thanks.


On Sat, Apr 27, 2013 at 6:21 PM, Vyacheslav Egorov <[email protected]>wrote:

> Non-smi values are allocated on the heap so they should be collected
> sooner or later. Though they might be temporary stuck in some cache.
>
> As Ben recommends it's better to put only Objects&Strings into weak
> persistent handles. [though strings can also be stuck in some cache
> for indefinite amount of time]
>
> Vyacheslav Egorov
>
>
> On Sat, Apr 27, 2013 at 10:36 AM, Dmitry Azaraev <[email protected]
> > wrote:
>
>> > Boolean values are eternal --- they never die. Small integers (31 bits
>> on ia32 and 32bits on x64) are
>> > not even allocated in the heap, they are *values* essentially so weak
>> reachability is undefined for them.
>>     Thanks. I'm trying allocate non-SMI values too - and got same result,
>> so looks, that exists some additional rule. May be exist easy way to detect
>> which values can be used as weak headles or no?
>>
>>
>> On Fri, Apr 26, 2013 at 10:54 PM, Vyacheslav Egorov <[email protected]
>> > wrote:
>>
>>> > So it is possible that persistent weak handles built on top of
>>> primitive values did not collected?
>>>
>>> Boolean values are eternal --- they never die. Small integers (31 bits
>>> on ia32 and 32bits on x64) are not even allocated in the heap, they are
>>> *values* essentially so weak reachability is undefined for them.
>>>
>>> > it is safe return persistent handle via raw return handle; instead of
>>> return handle_scope.Close(handle); ?
>>>
>>> Yes. You need to use Close only for Local handles. If you return
>>> Persistent handle you can just return that directly.
>>>
>>> --
>>> Vyacheslav Egorov
>>>
>>>
>>> On Fri, Apr 26, 2013 at 12:42 PM, Dmitry Azaraev <[email protected]>wrote:
>>>
>>>> Hi.
>>>>
>>>> My question initially originated from CEF V8 integration, described on
>>>> next issues:
>>>> https://code.google.com/p/chromiumembedded/issues/detail?id=323 ,
>>>> https://code.google.com/p/chromiumembedded/issues/detail?id=960 .
>>>>
>>>> In short problem looks as:
>>>> CEF creates persistent and weak handles for every created V8 value (
>>>> Boolean, Integers ). And in this case i found memory leak, when for example
>>>> our native function returns primitive value. For complex values (Object),
>>>> this is did not appear at all.
>>>>
>>>> So it is possible that persistent weak handles built on top of
>>>> primitive values did not collected?
>>>>
>>>> And additional question: it is safe return persistent handle via raw
>>>> return handle; instead of return handle_scope.Close(handle); ?
>>>>
>>>>  --
>>>> --
>>>> v8-users mailing list
>>>> [email protected]
>>>> http://groups.google.com/group/v8-users
>>>> ---
>>>> You received this message because you are subscribed to the Google
>>>> Groups "v8-users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to [email protected].
>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>
>>>>
>>>>
>>>
>>> --
>>> Vyacheslav Egorov
>>> Software Engineer
>>> Google Danmark ApS - Skt Petri Passage 5, 2 sal - 1165 København K -
>>> CVR nr. 28 86 69 84
>>>
>>>  --
>>> --
>>> v8-users mailing list
>>> [email protected]
>>> http://groups.google.com/group/v8-users
>>> ---
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "v8-users" group.
>>> To unsubscribe from this topic, visit
>>> https://groups.google.com/d/topic/v8-users/616ZM3UWh2k/unsubscribe?hl=en
>>> .
>>> To unsubscribe from this group and all its topics, send an email to
>>> [email protected].
>>>
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>>
>>>
>>
>>
>>
>> --
>> Best regards,
>>    Dmitry
>>
>> --
>> --
>> v8-users mailing list
>> [email protected]
>> http://groups.google.com/group/v8-users
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "v8-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>  --
> --
> v8-users mailing list
> [email protected]
> http://groups.google.com/group/v8-users
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "v8-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/v8-users/616ZM3UWh2k/unsubscribe?hl=en.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
Best regards,
   Dmitry

-- 
-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to