8205499: C1 temporary code buffers are not removed with -XX:+UseDynamicNumberOfCompilerThreads

Deallocate C1 code buffers in the compiler thread destructor.

Reviewed-by: neliasso, kvn, mdoerr
This commit is contained in:
Tobias Hartmann 2018-06-29 11:08:38 +02:00
parent 487db1a3bb
commit 5e002c7aa7
2 changed files with 5 additions and 6 deletions

View file

@ -3298,6 +3298,11 @@ CompilerThread::CompilerThread(CompileQueue* queue,
}
CompilerThread::~CompilerThread() {
// Free buffer blob, if allocated
if (get_buffer_blob() != NULL) {
MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
CodeCache::free(get_buffer_blob());
}
// Delete objects which were allocated on heap.
delete _counters;
}