Make hidumper api trigger shared full gc

Issue: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/IAUM1T

Signed-off-by: xiongluo <xiongluo@huawei.com>
Change-Id: I7b893c0042489d9330058942b8c05bb7c45f3df5
This commit is contained in:
xiongluo 2024-09-29 21:55:59 +08:00
parent d50c327b8a
commit 952dd2e92e

View File

@ -246,7 +246,7 @@ void DFXJSNApi::TriggerGC([[maybe_unused]] const EcmaVM *vm, [[maybe_unused]] ui
return;
}
});
// triggerSharedGC
// triggerSharedFullGC
TriggerSharedGCWithVm(vm);
}
@ -274,7 +274,8 @@ void DFXJSNApi::TriggerSharedGCWithVm([[maybe_unused]] const EcmaVM *vm)
ecmascript::SharedHeap* sHeap = ecmascript::SharedHeap::GetInstance();
JSThread *thread = vm->GetJSThread();
ecmascript::ThreadManagedScope managedScope(thread);
sHeap->CollectGarbage<ecmascript::TriggerGCType::SHARED_GC, ecmascript::GCReason::TRIGGER_BY_MEM_TOOLS>(thread);
sHeap->CollectGarbage<ecmascript::TriggerGCType::SHARED_FULL_GC,
ecmascript::GCReason::TRIGGER_BY_MEM_TOOLS>(thread);
delete work;
});
if (ret != 0) {