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