Skip to content

Commit

Permalink
[Bug] fix memory leakage problem in inference mode
Browse files Browse the repository at this point in the history
this patch fix a memory leakage issue in inference mode.

The problem occurred because even though deallocation was performed,
vectors inside the memory pool were still remained.

**Self evaluation:**

Build test: [x]Passed [ ]Failed [ ]Skipped
Run test: [x]Passed [ ]Failed [ ]Skipped

Signed-off-by: Seungbaek Hong <sb92.hong@samsung.com>
  • Loading branch information
baek2sm authored and jijoongmoon committed Feb 11, 2025
1 parent d00bb1b commit 37b1d2c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions nntrainer/tensor/memory_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ std::shared_ptr<MemoryData> MemoryPool::getMemory(unsigned int idx) {
void MemoryPool::deallocate() {
if (mem_pool != nullptr) {
free(mem_pool);
memory_size.clear();
memory_validity.clear();
memory_exec_order.clear();
memory_is_wgrad.clear();
PROFILE_MEM_DEALLOC(mem_pool);
}

Expand Down

0 comments on commit 37b1d2c

Please sign in to comment.