Skip to content

Commit a0677d9

Browse files
committed
8353263: Parallel: Remove locking in PSOldGen::resize
Reviewed-by: tschatzl, zgu
1 parent 8608b16 commit a0677d9

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/hotspot/share/gc/parallel/psOldGen.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,9 @@ bool PSOldGen::expand_to_reserved() {
262262
}
263263

264264
void PSOldGen::shrink(size_t bytes) {
265-
assert_lock_strong(PSOldGenExpand_lock);
266-
assert_locked_or_safepoint(Heap_lock);
265+
assert(Thread::current()->is_VM_thread(), "precondition");
266+
assert(SafepointSynchronize::is_at_safepoint(), "precondition");
267+
assert(bytes > 0, "precondition");
267268

268269
size_t size = align_down(bytes, virtual_space()->alignment());
269270
if (size > 0) {
@@ -314,11 +315,9 @@ void PSOldGen::resize(size_t desired_free_space) {
314315
}
315316
if (new_size > current_size) {
316317
size_t change_bytes = new_size - current_size;
317-
MutexLocker x(PSOldGenExpand_lock);
318318
expand(change_bytes);
319319
} else {
320320
size_t change_bytes = current_size - new_size;
321-
MutexLocker x(PSOldGenExpand_lock);
322321
shrink(change_bytes);
323322
}
324323

0 commit comments

Comments
 (0)