< prev index next >

src/share/vm/runtime/interfaceSupport.cpp

Print this page
rev 11777 : [mq]: gcinterface.patch


  79   // Short-circuit any possible re-entrant gc-a-lot attempt
  80   if (thread->skip_gcalot()) return;
  81 
  82   if (Threads::is_vm_complete()) {
  83 
  84     if (++_fullgc_alot_invocation < FullGCALotStart) {
  85       return;
  86     }
  87 
  88     // Use this line if you want to block at a specific point,
  89     // e.g. one number_of_calls/scavenge/gc before you got into problems
  90     if (FullGCALot) _fullgc_alot_counter--;
  91 
  92     // Check if we should force a full gc
  93     if (_fullgc_alot_counter == 0) {
  94       // Release dummy so objects are forced to move
  95       if (!Universe::release_fullgc_alot_dummy()) {
  96         warning("FullGCALot: Unable to release more dummies at bottom of heap");
  97       }
  98       HandleMark hm(thread);
  99       Universe::heap()->collect(GCCause::_full_gc_alot);
 100       unsigned int invocations = Universe::heap()->total_full_collections();
 101       // Compute new interval
 102       if (FullGCALotInterval > 1) {
 103         _fullgc_alot_counter = 1+(long)((double)FullGCALotInterval*os::random()/(max_jint+1.0));
 104         log_trace(gc)("Full gc no: %u\tInterval: %ld", invocations, _fullgc_alot_counter);
 105       } else {
 106         _fullgc_alot_counter = 1;
 107       }
 108       // Print progress message
 109       if (invocations % 100 == 0) {
 110         log_trace(gc)("Full gc no: %u", invocations);
 111       }
 112     } else {
 113       if (ScavengeALot) _scavenge_alot_counter--;
 114       // Check if we should force a scavenge
 115       if (_scavenge_alot_counter == 0) {
 116         HandleMark hm(thread);
 117         Universe::heap()->collect(GCCause::_scavenge_alot);
 118         unsigned int invocations = Universe::heap()->total_collections() - Universe::heap()->total_full_collections();
 119         // Compute new interval
 120         if (ScavengeALotInterval > 1) {
 121           _scavenge_alot_counter = 1+(long)((double)ScavengeALotInterval*os::random()/(max_jint+1.0));
 122           log_trace(gc)("Scavenge no: %u\tInterval: %ld", invocations, _scavenge_alot_counter);
 123         } else {
 124           _scavenge_alot_counter = 1;
 125         }
 126         // Print progress message
 127         if (invocations % 1000 == 0) {
 128           log_trace(gc)("Scavenge no: %u", invocations);
 129         }
 130       }
 131     }
 132   }
 133 }
 134 
 135 
 136 vframe* vframe_array[50];
 137 int walk_stack_counter = 0;
 138 




  79   // Short-circuit any possible re-entrant gc-a-lot attempt
  80   if (thread->skip_gcalot()) return;
  81 
  82   if (Threads::is_vm_complete()) {
  83 
  84     if (++_fullgc_alot_invocation < FullGCALotStart) {
  85       return;
  86     }
  87 
  88     // Use this line if you want to block at a specific point,
  89     // e.g. one number_of_calls/scavenge/gc before you got into problems
  90     if (FullGCALot) _fullgc_alot_counter--;
  91 
  92     // Check if we should force a full gc
  93     if (_fullgc_alot_counter == 0) {
  94       // Release dummy so objects are forced to move
  95       if (!Universe::release_fullgc_alot_dummy()) {
  96         warning("FullGCALot: Unable to release more dummies at bottom of heap");
  97       }
  98       HandleMark hm(thread);
  99       GC::gc()->heap()->collect(GCCause::_full_gc_alot);
 100       unsigned int invocations = GC::gc()->heap()->total_full_collections();
 101       // Compute new interval
 102       if (FullGCALotInterval > 1) {
 103         _fullgc_alot_counter = 1+(long)((double)FullGCALotInterval*os::random()/(max_jint+1.0));
 104         log_trace(gc)("Full gc no: %u\tInterval: %ld", invocations, _fullgc_alot_counter);
 105       } else {
 106         _fullgc_alot_counter = 1;
 107       }
 108       // Print progress message
 109       if (invocations % 100 == 0) {
 110         log_trace(gc)("Full gc no: %u", invocations);
 111       }
 112     } else {
 113       if (ScavengeALot) _scavenge_alot_counter--;
 114       // Check if we should force a scavenge
 115       if (_scavenge_alot_counter == 0) {
 116         HandleMark hm(thread);
 117         GC::gc()->heap()->collect(GCCause::_scavenge_alot);
 118         unsigned int invocations = GC::gc()->heap()->total_collections() - GC::gc()->heap()->total_full_collections();
 119         // Compute new interval
 120         if (ScavengeALotInterval > 1) {
 121           _scavenge_alot_counter = 1+(long)((double)ScavengeALotInterval*os::random()/(max_jint+1.0));
 122           log_trace(gc)("Scavenge no: %u\tInterval: %ld", invocations, _scavenge_alot_counter);
 123         } else {
 124           _scavenge_alot_counter = 1;
 125         }
 126         // Print progress message
 127         if (invocations % 1000 == 0) {
 128           log_trace(gc)("Scavenge no: %u", invocations);
 129         }
 130       }
 131     }
 132   }
 133 }
 134 
 135 
 136 vframe* vframe_array[50];
 137 int walk_stack_counter = 0;
 138 


< prev index next >