equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
258 |
258 |
259 HeapWord* result = young_gen()->allocate(size); |
259 HeapWord* result = young_gen()->allocate(size); |
260 |
260 |
261 uint loop_count = 0; |
261 uint loop_count = 0; |
262 uint gc_count = 0; |
262 uint gc_count = 0; |
263 int gclocker_stalled_count = 0; |
263 uint gclocker_stalled_count = 0; |
264 |
264 |
265 while (result == NULL) { |
265 while (result == NULL) { |
266 // We don't want to have multiple collections for a single filled generation. |
266 // We don't want to have multiple collections for a single filled generation. |
267 // To prevent this, each thread tracks the total_collections() value, and if |
267 // To prevent this, each thread tracks the total_collections() value, and if |
268 // the count has changed, does not do a new collection. |
268 // the count has changed, does not do a new collection. |
518 // This method is used by System.gc() and JVMTI. |
518 // This method is used by System.gc() and JVMTI. |
519 void ParallelScavengeHeap::collect(GCCause::Cause cause) { |
519 void ParallelScavengeHeap::collect(GCCause::Cause cause) { |
520 assert(!Heap_lock->owned_by_self(), |
520 assert(!Heap_lock->owned_by_self(), |
521 "this thread should not own the Heap_lock"); |
521 "this thread should not own the Heap_lock"); |
522 |
522 |
523 unsigned int gc_count = 0; |
523 uint gc_count = 0; |
524 unsigned int full_gc_count = 0; |
524 uint full_gc_count = 0; |
525 { |
525 { |
526 MutexLocker ml(Heap_lock); |
526 MutexLocker ml(Heap_lock); |
527 // This value is guarded by the Heap_lock |
527 // This value is guarded by the Heap_lock |
528 gc_count = Universe::heap()->total_collections(); |
528 gc_count = Universe::heap()->total_collections(); |
529 full_gc_count = Universe::heap()->total_full_collections(); |
529 full_gc_count = Universe::heap()->total_full_collections(); |