From 0ed42e96f711bbe5287f77e1f04bbed02266d7f2 Mon Sep 17 00:00:00 2001 From: zhaozhixuan Date: Wed, 23 Jun 2021 17:29:54 +0800 Subject: [PATCH] Fix mem leak and recursive depth protection --- ge/common/ge/tbe_plugin_manager.cc | 1 + ge/hybrid/node_executor/task_context.cc | 2 ++ 2 files changed, 3 insertions(+) diff --git a/ge/common/ge/tbe_plugin_manager.cc b/ge/common/ge/tbe_plugin_manager.cc index c876e300..6a461a6d 100755 --- a/ge/common/ge/tbe_plugin_manager.cc +++ b/ge/common/ge/tbe_plugin_manager.cc @@ -156,6 +156,7 @@ void TBEPluginManager::FindParserSo(const string &path, vector &file_lis } mmScandirFree(entries, ret); temp_depth--; + return; } void TBEPluginManager::GetPluginSoFileList(const string &path, vector &file_list, string &caffe_parser_path) { diff --git a/ge/hybrid/node_executor/task_context.cc b/ge/hybrid/node_executor/task_context.cc index 78ccb54a..c0464c87 100644 --- a/ge/hybrid/node_executor/task_context.cc +++ b/ge/hybrid/node_executor/task_context.cc @@ -43,6 +43,7 @@ TaskContext::~TaskContext() { output_tensor->Destroy(); } } + ReleaseWorkspace(); } void TaskContext::ReleaseWorkspace() { @@ -50,6 +51,7 @@ void TaskContext::ReleaseWorkspace() { for (auto ws_addr : workspaces_) { execution_context_->allocator->Deallocate(ws_addr); } + workspaces_.clear(); } std::unique_ptr TaskContext::Create(NodeState *node_state, SubgraphContext *subgraph_context) {