Skip to content

Commit

Permalink
[JIT] Fix mem leak for ReduceNMethodSize
Browse files Browse the repository at this point in the history
Summary: free immutable data in nmethod::flush

Testing: test/hotspot/jtreg/compiler/codecache/stress/UnexpectedDeoptimizationTest.java

Reviewers: lusou.zq, yueshi.zwj

Issue: dragonwell-project#861
  • Loading branch information
kuaiwei committed Sep 11, 2024
1 parent 26f863a commit 5feb916
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/hotspot/share/code/nmethod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1396,6 +1396,11 @@ void nmethod::flush() {
assert(_speculation_log == NULL, "should have been nulled out when transitioned to zombie");
#endif

if (ReduceNMethodSize && _immutable_data_size > 0) {
assert(_immutable_data != data_end(), "must be");
os::free(_immutable_data);
_immutable_data = data_end();
}
CodeBlob::flush();
CodeCache::free(this);
}
Expand Down

0 comments on commit 5feb916

Please sign in to comment.