File tree 1 file changed +9
-5
lines changed 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -456,12 +456,16 @@ std::string getHeapStatisticsString(v8::HeapStatistics & heap_statistics)
456
456
457
457
void checkHeapLimit (v8::Isolate * isolate, size_t max_v8_heap_size_in_bytes)
458
458
{
459
- v8::Locker locker (isolate);
460
- v8::Isolate::Scope isolate_scope (isolate);
461
- v8::HandleScope handle_scope (isolate);
462
- v8::HandleScope scope (isolate);
463
459
v8::HeapStatistics heap_statistics;
464
- isolate->GetHeapStatistics (&heap_statistics);
460
+
461
+ // / Lock only for getting heap statistics
462
+ {
463
+ v8::Locker locker (isolate);
464
+ v8::Isolate::Scope isolate_scope (isolate);
465
+ v8::HandleScope handle_scope (isolate);
466
+ v8::HandleScope scope (isolate);
467
+ isolate->GetHeapStatistics (&heap_statistics);
468
+ }
465
469
466
470
auto used = heap_statistics.used_heap_size ();
467
471
auto total = heap_statistics.heap_size_limit ();
You can’t perform that action at this time.
0 commit comments