mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 12:09:14 +00:00
8353263: Parallel: Remove locking in PSOldGen::resize
Reviewed-by: tschatzl, zgu
This commit is contained in:
parent
8608b16341
commit
a0677d94d8
@ -262,8 +262,9 @@ bool PSOldGen::expand_to_reserved() {
|
||||
}
|
||||
|
||||
void PSOldGen::shrink(size_t bytes) {
|
||||
assert_lock_strong(PSOldGenExpand_lock);
|
||||
assert_locked_or_safepoint(Heap_lock);
|
||||
assert(Thread::current()->is_VM_thread(), "precondition");
|
||||
assert(SafepointSynchronize::is_at_safepoint(), "precondition");
|
||||
assert(bytes > 0, "precondition");
|
||||
|
||||
size_t size = align_down(bytes, virtual_space()->alignment());
|
||||
if (size > 0) {
|
||||
@ -314,11 +315,9 @@ void PSOldGen::resize(size_t desired_free_space) {
|
||||
}
|
||||
if (new_size > current_size) {
|
||||
size_t change_bytes = new_size - current_size;
|
||||
MutexLocker x(PSOldGenExpand_lock);
|
||||
expand(change_bytes);
|
||||
} else {
|
||||
size_t change_bytes = current_size - new_size;
|
||||
MutexLocker x(PSOldGenExpand_lock);
|
||||
shrink(change_bytes);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user