Re: [v8-users] Isolate destruction "leaking" memory ?

2018-05-14 Thread YJ
Hi Jakob,

I meant it is NOT something is caught by valgrind.

I cannot get valgrind to work on my mac running sierra. But on linux 
valgrind finds no concrete leak with the program. By changing the loop 
iteration count, valgrind always gives the same results.

On Tuesday, May 15, 2018 at 2:20:20 AM UTC+8, Jakob Kummerow wrote:
>
> Never mind; that shouldn't be needed, as isolate->Dispose() contains delete 
> this. Funky!
>
> You said "it can be caught by valgrind". What does Valgrind report?
>
> On Mon, May 14, 2018 at 11:16 AM Jakob Kummerow  > wrote:
>
>> One obvious observation is that you don't have a delete isolate; statement 
>> in the loop ;-)
>>
>> On Sat, May 12, 2018 at 8:42 AM YJ  
>> wrote:
>>
>>> Kinda related to this old thread 
>>> https://groups.google.com/forum/#!searchin/v8-users/isolate$20memory|sort:date/v8-users/C_CzX8nSbDU/c4FR8-j6BQAJ
>>>
>>> Basically, I'd imagine if I instantiate an isolate and immediately 
>>> "Dispose" it inside a loop, all memory used by the isolated should be 
>>> released therefore the loop could go on forever. In reality however, doing 
>>> this would consume all available memories and doesn't seem to release any 
>>> memory back to the os at all. It is not a "leak" in the sense that it can 
>>> be caught by valgrind, it appears something is actually hogging the memory. 
>>> I am really curious of what is holding onto the memory. I really hope I am 
>>> just missing something obvious and any help is appreciated.
>>>
>>> I test the following code on a MBP
>>>
>>> #include "v8/include/v8.h"
>>> #include "v8/include/libplatform/libplatform.h"
>>>
>>> int main(int argc, char* argv[]) {
>>>   v8::V8::InitializeICUDefaultLocation(V8_LIB_FULL_PATH);
>>>   v8::V8::InitializeExternalStartupData(V8_LIB_FULL_PATH);
>>>   std::unique_ptr platform = 
>>> v8::platform::NewDefaultPlatform();
>>>   v8::V8::InitializePlatform(platform.get());
>>>   v8::V8::Initialize();
>>>   for (auto i = 0; i < 10; ++i) {
>>> v8::Isolate::CreateParams create_params;
>>> create_params.array_buffer_allocator = 
>>> v8::ArrayBuffer::Allocator::NewDefaultAllocator();
>>> v8::Isolate* isolate = v8::Isolate::New(create_params);
>>> isolate->Dispose();
>>> delete create_params.array_buffer_allocator;
>>>   }
>>>   v8::V8::Dispose();
>>>   v8::V8::ShutdownPlatform();
>>> }
>>>
>>> It will run until all memory is gone and macOS will just be unresponsive.
>>>
>>> I was using v8 version 6.5 and with the following build args
>>>
>>> is_debug = false
>>> target_cpu = "x64"
>>> use_drfuzz = false
>>> use_libfuzzer = false
>>> v8_enable_test_features = ""
>>> v8_experimental_extra_library_files = []
>>> v8_extra_library_files = []
>>> symbol_level = 1
>>> is_component_build = false
>>> use_sysroot = false
>>> use_glib = false
>>> use_custom_libcxx = false
>>> use_custom_libcxx_for_host = false
>>> v8_enable_i18n_support = false
>>> icu_use_data_file = false
>>> v8_static_library = true
>>> v8_enable_gdbjit = false
>>>
>>> Thanks
>>>
>>> -- 
>>> -- 
>>> v8-users mailing list
>>> v8-u...@googlegroups.com 
>>> 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 v8-users+u...@googlegroups.com .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
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 v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [v8-users] Clarification on AllowJavascriptExecution

2018-05-14 Thread Jakob Kummerow
Yes.

On Fri, May 11, 2018 at 8:47 PM madana gopal 
wrote:

> Thanks, ok. let me go through and update. We have both Script.Run() calls
> and vm.runScript() calls in our project.
>
> So, we have to make sure, we are not making any JS calls, when either
> Run() or vm.runScript()  going on (as they will involve in code
> compilation) and need to wait for its completion. Is my understanding right
> Jakob?
>
> Thanks.
>
> Regards,
> Madan
>
> --
> --
> v8-users mailing list
> v8-users@googlegroups.com
> 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 v8-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
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 v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [v8-users] Isolate destruction "leaking" memory ?

2018-05-14 Thread Jakob Kummerow
Never mind; that shouldn't be needed, as isolate->Dispose() contains delete
this. Funky!

You said "it can be caught by valgrind". What does Valgrind report?

On Mon, May 14, 2018 at 11:16 AM Jakob Kummerow 
wrote:

> One obvious observation is that you don't have a delete isolate; statement
> in the loop ;-)
>
> On Sat, May 12, 2018 at 8:42 AM YJ  wrote:
>
>> Kinda related to this old thread
>> https://groups.google.com/forum/#!searchin/v8-users/isolate$20memory|sort:date/v8-users/C_CzX8nSbDU/c4FR8-j6BQAJ
>>
>> Basically, I'd imagine if I instantiate an isolate and immediately
>> "Dispose" it inside a loop, all memory used by the isolated should be
>> released therefore the loop could go on forever. In reality however, doing
>> this would consume all available memories and doesn't seem to release any
>> memory back to the os at all. It is not a "leak" in the sense that it can
>> be caught by valgrind, it appears something is actually hogging the memory.
>> I am really curious of what is holding onto the memory. I really hope I am
>> just missing something obvious and any help is appreciated.
>>
>> I test the following code on a MBP
>>
>> #include "v8/include/v8.h"
>> #include "v8/include/libplatform/libplatform.h"
>>
>> int main(int argc, char* argv[]) {
>>   v8::V8::InitializeICUDefaultLocation(V8_LIB_FULL_PATH);
>>   v8::V8::InitializeExternalStartupData(V8_LIB_FULL_PATH);
>>   std::unique_ptr platform =
>> v8::platform::NewDefaultPlatform();
>>   v8::V8::InitializePlatform(platform.get());
>>   v8::V8::Initialize();
>>   for (auto i = 0; i < 10; ++i) {
>> v8::Isolate::CreateParams create_params;
>> create_params.array_buffer_allocator =
>> v8::ArrayBuffer::Allocator::NewDefaultAllocator();
>> v8::Isolate* isolate = v8::Isolate::New(create_params);
>> isolate->Dispose();
>> delete create_params.array_buffer_allocator;
>>   }
>>   v8::V8::Dispose();
>>   v8::V8::ShutdownPlatform();
>> }
>>
>> It will run until all memory is gone and macOS will just be unresponsive.
>>
>> I was using v8 version 6.5 and with the following build args
>>
>> is_debug = false
>> target_cpu = "x64"
>> use_drfuzz = false
>> use_libfuzzer = false
>> v8_enable_test_features = ""
>> v8_experimental_extra_library_files = []
>> v8_extra_library_files = []
>> symbol_level = 1
>> is_component_build = false
>> use_sysroot = false
>> use_glib = false
>> use_custom_libcxx = false
>> use_custom_libcxx_for_host = false
>> v8_enable_i18n_support = false
>> icu_use_data_file = false
>> v8_static_library = true
>> v8_enable_gdbjit = false
>>
>> Thanks
>>
>> --
>> --
>> v8-users mailing list
>> v8-users@googlegroups.com
>> 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 v8-users+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
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 v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [v8-users] Isolate destruction "leaking" memory ?

2018-05-14 Thread Jakob Kummerow
One obvious observation is that you don't have a delete isolate; statement
in the loop ;-)

On Sat, May 12, 2018 at 8:42 AM YJ  wrote:

> Kinda related to this old thread
> https://groups.google.com/forum/#!searchin/v8-users/isolate$20memory|sort:date/v8-users/C_CzX8nSbDU/c4FR8-j6BQAJ
>
> Basically, I'd imagine if I instantiate an isolate and immediately
> "Dispose" it inside a loop, all memory used by the isolated should be
> released therefore the loop could go on forever. In reality however, doing
> this would consume all available memories and doesn't seem to release any
> memory back to the os at all. It is not a "leak" in the sense that it can
> be caught by valgrind, it appears something is actually hogging the memory.
> I am really curious of what is holding onto the memory. I really hope I am
> just missing something obvious and any help is appreciated.
>
> I test the following code on a MBP
>
> #include "v8/include/v8.h"
> #include "v8/include/libplatform/libplatform.h"
>
> int main(int argc, char* argv[]) {
>   v8::V8::InitializeICUDefaultLocation(V8_LIB_FULL_PATH);
>   v8::V8::InitializeExternalStartupData(V8_LIB_FULL_PATH);
>   std::unique_ptr platform =
> v8::platform::NewDefaultPlatform();
>   v8::V8::InitializePlatform(platform.get());
>   v8::V8::Initialize();
>   for (auto i = 0; i < 10; ++i) {
> v8::Isolate::CreateParams create_params;
> create_params.array_buffer_allocator =
> v8::ArrayBuffer::Allocator::NewDefaultAllocator();
> v8::Isolate* isolate = v8::Isolate::New(create_params);
> isolate->Dispose();
> delete create_params.array_buffer_allocator;
>   }
>   v8::V8::Dispose();
>   v8::V8::ShutdownPlatform();
> }
>
> It will run until all memory is gone and macOS will just be unresponsive.
>
> I was using v8 version 6.5 and with the following build args
>
> is_debug = false
> target_cpu = "x64"
> use_drfuzz = false
> use_libfuzzer = false
> v8_enable_test_features = ""
> v8_experimental_extra_library_files = []
> v8_extra_library_files = []
> symbol_level = 1
> is_component_build = false
> use_sysroot = false
> use_glib = false
> use_custom_libcxx = false
> use_custom_libcxx_for_host = false
> v8_enable_i18n_support = false
> icu_use_data_file = false
> v8_static_library = true
> v8_enable_gdbjit = false
>
> Thanks
>
> --
> --
> v8-users mailing list
> v8-users@googlegroups.com
> 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 v8-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
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 v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.