Skip to content

Commit 6086f94

Browse files
authored
Merge pull request #7627 from mstoodle/fix_leak
Fix memory leaks in OMRCodeCacheManager.cpp
2 parents 74871b1 + 0083583 commit 6086f94

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

compiler/runtime/OMRCodeCacheManager.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,14 @@ OMR::CodeCacheManager::destroy()
222222
_symbolContainer->_totalSymbolNameLength),
223223
"Failed to write code cache symbols to relocatable ELF file.");
224224
}
225+
225226
}
227+
228+
if (_symbolContainer)
229+
{
230+
self()->freeMemory(_symbolContainer);
231+
_symbolContainer = NULL;
232+
}
226233
#endif // HOST_OS == OMR_LINUX
227234

228235
TR::CodeCache *codeCache = self()->getFirstCodeCache();
@@ -239,6 +246,10 @@ OMR::CodeCacheManager::destroy()
239246
self()->freeCodeCacheSegment(_codeCacheRepositorySegment);
240247
}
241248

249+
TR::Monitor::destroy(_usageMonitor);
250+
TR::Monitor::destroy(_codeCacheList._mutex);
251+
TR::Monitor::destroy(_codeCacheRepositoryMonitor);
252+
242253
_initialized = false;
243254
}
244255

0 commit comments

Comments
 (0)