mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2025-02-17 10:18:13 +00:00
Fix HeapProfiler memory leak
Issue: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I7RNIW Signed-off-by: xwcai98 <xwcai98@gmail.com> Change-Id: I6eb4d14f1d05b93f51188b9af4fa88b4083818d5
This commit is contained in:
parent
abbeed23b7
commit
9a9d72b678
@ -230,6 +230,9 @@ EcmaVM::~EcmaVM()
|
||||
initialized_ = false;
|
||||
#if defined(ECMASCRIPT_SUPPORT_CPUPROFILER)
|
||||
DFXJSNApi::StopCpuProfilerForFile(this);
|
||||
#endif
|
||||
#if defined(ECMASCRIPT_SUPPORT_HEAPPROFILER)
|
||||
DeleteHeapProfile();
|
||||
#endif
|
||||
heap_->WaitAllTasksFinished();
|
||||
Taskpool::GetCurrentTaskpool()->Destroy(thread_->GetThreadId());
|
||||
|
@ -119,7 +119,7 @@ void DFXJSNApi::DumpHeapSnapshot([[maybe_unused]] const EcmaVM *vm, [[maybe_unus
|
||||
#endif // ECMASCRIPT_SUPPORT_SNAPSHOT
|
||||
}
|
||||
|
||||
void DFXJSNApi::DestroyProfiler([[maybe_unused]] const EcmaVM *vm)
|
||||
void DFXJSNApi::DestroyHeapProfiler([[maybe_unused]] const EcmaVM *vm)
|
||||
{
|
||||
#if defined(ECMASCRIPT_SUPPORT_SNAPSHOT)
|
||||
ecmascript::HeapProfilerInterface::Destroy(const_cast<EcmaVM *>(vm));
|
||||
|
@ -55,7 +55,7 @@ public:
|
||||
static void DumpHeapSnapshot(const EcmaVM *vm, int dumpFormat, Stream *stream, Progress *progress = nullptr,
|
||||
bool isVmMode = true, bool isPrivate = false);
|
||||
static void DumpHeapSnapshot(const EcmaVM *vm, int dumpFormat, bool isVmMode = true, bool isPrivate = false);
|
||||
static void DestroyProfiler(const EcmaVM *vm);
|
||||
static void DestroyHeapProfiler(const EcmaVM *vm);
|
||||
|
||||
static bool BuildNativeAndJsStackTrace(const EcmaVM *vm, std::string &stackTraceStr);
|
||||
static bool BuildJsStackTrace(const EcmaVM *vm, std::string &stackTraceStr);
|
||||
|
Loading…
x
Reference in New Issue
Block a user