@@ -163,7 +163,7 @@ bool PSOldGen::expand_for_allocate(size_t word_size) {
163163 assert (word_size > 0 , " allocating zero words?" );
164164 bool result = true ;
165165 {
166- MutexLocker x (ExpandHeap_lock );
166+ MutexLocker x (PSOldGenExpand_lock );
167167 // Avoid "expand storms" by rechecking available space after obtaining
168168 // the lock, because another thread may have already made sufficient
169169 // space available. If insufficient space available, that will remain
@@ -181,7 +181,7 @@ bool PSOldGen::expand_for_allocate(size_t word_size) {
181181}
182182
183183bool PSOldGen::expand (size_t bytes) {
184- assert_lock_strong (ExpandHeap_lock );
184+ assert_lock_strong (PSOldGenExpand_lock );
185185 assert_locked_or_safepoint (Heap_lock);
186186 assert (bytes > 0 , " precondition" );
187187 const size_t alignment = virtual_space ()->alignment ();
@@ -219,7 +219,7 @@ bool PSOldGen::expand(size_t bytes) {
219219}
220220
221221bool PSOldGen::expand_by (size_t bytes) {
222- assert_lock_strong (ExpandHeap_lock );
222+ assert_lock_strong (PSOldGenExpand_lock );
223223 assert_locked_or_safepoint (Heap_lock);
224224 assert (bytes > 0 , " precondition" );
225225 bool result = virtual_space ()->expand_by (bytes);
@@ -255,7 +255,7 @@ bool PSOldGen::expand_by(size_t bytes) {
255255}
256256
257257bool PSOldGen::expand_to_reserved () {
258- assert_lock_strong (ExpandHeap_lock );
258+ assert_lock_strong (PSOldGenExpand_lock );
259259 assert_locked_or_safepoint (Heap_lock);
260260
261261 bool result = false ;
@@ -268,12 +268,11 @@ bool PSOldGen::expand_to_reserved() {
268268}
269269
270270void PSOldGen::shrink (size_t bytes) {
271- assert_lock_strong (ExpandHeap_lock );
271+ assert_lock_strong (PSOldGenExpand_lock );
272272 assert_locked_or_safepoint (Heap_lock);
273273
274274 size_t size = align_down (bytes, virtual_space ()->alignment ());
275275 if (size > 0 ) {
276- assert_lock_strong (ExpandHeap_lock);
277276 virtual_space ()->shrink_by (bytes);
278277 post_resize ();
279278
@@ -312,11 +311,11 @@ void PSOldGen::resize(size_t desired_free_space) {
312311 }
313312 if (new_size > current_size) {
314313 size_t change_bytes = new_size - current_size;
315- MutexLocker x (ExpandHeap_lock );
314+ MutexLocker x (PSOldGenExpand_lock );
316315 expand (change_bytes);
317316 } else {
318317 size_t change_bytes = current_size - new_size;
319- MutexLocker x (ExpandHeap_lock );
318+ MutexLocker x (PSOldGenExpand_lock );
320319 shrink (change_bytes);
321320 }
322321
0 commit comments