comparison src/share/vm/gc_implementation/g1/g1CollectedHeap.inline.hpp @ 8853:2e093b564241

7014552: gc/lock/jni/jnilockXXX works too slow on 1-processor machine Summary: Keep a counter of how many times we were stalled by the GC locker, add a diagnostic flag which sets the limit. Reviewed-by: brutisso, ehelin, johnc
author mgerdin
date Thu, 28 Mar 2013 10:27:28 +0100
parents c9814fadeb38
children b9a918201d47 d55c004e1d4d
comparison
equal deleted inserted replaced
8827:42e370795a39 8853:2e093b564241
58 return r != NULL && r->in_collection_set(); 58 return r != NULL && r->in_collection_set();
59 } 59 }
60 60
61 inline HeapWord* 61 inline HeapWord*
62 G1CollectedHeap::attempt_allocation(size_t word_size, 62 G1CollectedHeap::attempt_allocation(size_t word_size,
63 unsigned int* gc_count_before_ret) { 63 unsigned int* gc_count_before_ret,
64 int* gclocker_retry_count_ret) {
64 assert_heap_not_locked_and_not_at_safepoint(); 65 assert_heap_not_locked_and_not_at_safepoint();
65 assert(!isHumongous(word_size), "attempt_allocation() should not " 66 assert(!isHumongous(word_size), "attempt_allocation() should not "
66 "be called for humongous allocation requests"); 67 "be called for humongous allocation requests");
67 68
68 HeapWord* result = _mutator_alloc_region.attempt_allocation(word_size, 69 HeapWord* result = _mutator_alloc_region.attempt_allocation(word_size,
69 false /* bot_updates */); 70 false /* bot_updates */);
70 if (result == NULL) { 71 if (result == NULL) {
71 result = attempt_allocation_slow(word_size, gc_count_before_ret); 72 result = attempt_allocation_slow(word_size,
73 gc_count_before_ret,
74 gclocker_retry_count_ret);
72 } 75 }
73 assert_heap_not_locked(); 76 assert_heap_not_locked();
74 if (result != NULL) { 77 if (result != NULL) {
75 dirty_young_block(result, word_size); 78 dirty_young_block(result, word_size);
76 } 79 }