Skip to content

Commit

Permalink
8318720: G1: Memory leak in G1CodeRootSet after JDK-8315503
Browse files Browse the repository at this point in the history
Reviewed-by: tschatzl
  • Loading branch information
zhengyu123 committed Oct 25, 2023
1 parent a542f73 commit 811b436
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/hotspot/share/gc/g1/g1CodeRootSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,11 @@ class G1CodeRootSetHashTable : public CHeapObj<mtGC> {
}

void clear() {
_table.unsafe_reset();
Atomic::store(&_num_entries, (size_t)0);
// Remove all entries.
auto always_true = [] (nmethod** value) {
return true;
};
clean(always_true);
}

void iterate_at_safepoint(CodeBlobClosure* blk) {
Expand Down

1 comment on commit 811b436

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.