68 }
69
70 RuntimeHistogram->add_element(this);
71 Atomic::dec(&RuntimeHistogram_lock);
72 }
73
74 void InterfaceSupport::trace(const char* result_type, const char* header) {
75 tty->print_cr("%6d %s", _number_of_calls, header);
76 }
77
78 void InterfaceSupport::gc_alot() {
79 Thread *thread = Thread::current();
80 if (!thread->is_Java_thread()) return; // Avoid concurrent calls
81 // Check for new, not quite initialized thread. A thread in new mode cannot initiate a GC.
82 JavaThread *current_thread = (JavaThread *)thread;
83 if (current_thread->active_handles() == NULL) return;
84
85 // Short-circuit any possible re-entrant gc-a-lot attempt
86 if (thread->skip_gcalot()) return;
87
88 if (is_init_completed()) {
89
90 if (++_fullgc_alot_invocation < FullGCALotStart) {
91 return;
92 }
93
94 // Use this line if you want to block at a specific point,
95 // e.g. one number_of_calls/scavenge/gc before you got into problems
96 if (FullGCALot) _fullgc_alot_counter--;
97
98 // Check if we should force a full gc
99 if (_fullgc_alot_counter == 0) {
100 // Release dummy so objects are forced to move
101 if (!Universe::release_fullgc_alot_dummy()) {
102 warning("FullGCALot: Unable to release more dummies at bottom of heap");
103 }
104 HandleMark hm(thread);
105 Universe::heap()->collect(GCCause::_full_gc_alot);
106 unsigned int invocations = Universe::heap()->total_full_collections();
107 // Compute new interval
108 if (FullGCALotInterval > 1) {
|
68 }
69
70 RuntimeHistogram->add_element(this);
71 Atomic::dec(&RuntimeHistogram_lock);
72 }
73
74 void InterfaceSupport::trace(const char* result_type, const char* header) {
75 tty->print_cr("%6d %s", _number_of_calls, header);
76 }
77
78 void InterfaceSupport::gc_alot() {
79 Thread *thread = Thread::current();
80 if (!thread->is_Java_thread()) return; // Avoid concurrent calls
81 // Check for new, not quite initialized thread. A thread in new mode cannot initiate a GC.
82 JavaThread *current_thread = (JavaThread *)thread;
83 if (current_thread->active_handles() == NULL) return;
84
85 // Short-circuit any possible re-entrant gc-a-lot attempt
86 if (thread->skip_gcalot()) return;
87
88 if (Threads::is_vm_complete()) {
89
90 if (++_fullgc_alot_invocation < FullGCALotStart) {
91 return;
92 }
93
94 // Use this line if you want to block at a specific point,
95 // e.g. one number_of_calls/scavenge/gc before you got into problems
96 if (FullGCALot) _fullgc_alot_counter--;
97
98 // Check if we should force a full gc
99 if (_fullgc_alot_counter == 0) {
100 // Release dummy so objects are forced to move
101 if (!Universe::release_fullgc_alot_dummy()) {
102 warning("FullGCALot: Unable to release more dummies at bottom of heap");
103 }
104 HandleMark hm(thread);
105 Universe::heap()->collect(GCCause::_full_gc_alot);
106 unsigned int invocations = Universe::heap()->total_full_collections();
107 // Compute new interval
108 if (FullGCALotInterval > 1) {
|