< prev index next >

src/share/vm/runtime/interfaceSupport.cpp

Print this page




  85     if (++_fullgc_alot_invocation < FullGCALotStart) {
  86       return;
  87     }
  88 
  89     // Use this line if you want to block at a specific point,
  90     // e.g. one number_of_calls/scavenge/gc before you got into problems
  91     if (FullGCALot) _fullgc_alot_counter--;
  92 
  93     // Check if we should force a full gc
  94     if (_fullgc_alot_counter == 0) {
  95       // Release dummy so objects are forced to move
  96       if (!Universe::release_fullgc_alot_dummy()) {
  97         warning("FullGCALot: Unable to release more dummies at bottom of heap");
  98       }
  99       HandleMark hm(thread);
 100       Universe::heap()->collect(GCCause::_full_gc_alot);
 101       unsigned int invocations = Universe::heap()->total_full_collections();
 102       // Compute new interval
 103       if (FullGCALotInterval > 1) {
 104         _fullgc_alot_counter = 1+(long)((double)FullGCALotInterval*os::random()/(max_jint+1.0));
 105         if (PrintGCDetails && Verbose) {
 106           tty->print_cr("Full gc no: %u\tInterval: %ld", invocations, _fullgc_alot_counter);
 107         }
 108       } else {
 109         _fullgc_alot_counter = 1;
 110       }
 111       // Print progress message
 112       if (invocations % 100 == 0) {
 113         if (PrintGCDetails && Verbose) tty->print_cr("Full gc no: %u", invocations);
 114       }
 115     } else {
 116       if (ScavengeALot) _scavenge_alot_counter--;
 117       // Check if we should force a scavenge
 118       if (_scavenge_alot_counter == 0) {
 119         HandleMark hm(thread);
 120         Universe::heap()->collect(GCCause::_scavenge_alot);
 121         unsigned int invocations = Universe::heap()->total_collections() - Universe::heap()->total_full_collections();
 122         // Compute new interval
 123         if (ScavengeALotInterval > 1) {
 124           _scavenge_alot_counter = 1+(long)((double)ScavengeALotInterval*os::random()/(max_jint+1.0));
 125           if (PrintGCDetails && Verbose) {
 126             tty->print_cr("Scavenge no: %u\tInterval: %ld", invocations, _scavenge_alot_counter);
 127           }
 128         } else {
 129           _scavenge_alot_counter = 1;
 130         }
 131         // Print progress message
 132         if (invocations % 1000 == 0) {
 133           if (PrintGCDetails && Verbose) tty->print_cr("Scavenge no: %u", invocations);
 134         }
 135       }
 136     }
 137   }
 138 }
 139 
 140 
 141 vframe* vframe_array[50];
 142 int walk_stack_counter = 0;
 143 
 144 void InterfaceSupport::walk_stack_from(vframe* start_vf) {
 145   // walk
 146   int i = 0;
 147   for (vframe* f = start_vf; f; f = f->sender() ) {
 148     if (i < 50) vframe_array[i++] = f;
 149   }
 150 }
 151 
 152 
 153 void InterfaceSupport::walk_stack() {




  85     if (++_fullgc_alot_invocation < FullGCALotStart) {
  86       return;
  87     }
  88 
  89     // Use this line if you want to block at a specific point,
  90     // e.g. one number_of_calls/scavenge/gc before you got into problems
  91     if (FullGCALot) _fullgc_alot_counter--;
  92 
  93     // Check if we should force a full gc
  94     if (_fullgc_alot_counter == 0) {
  95       // Release dummy so objects are forced to move
  96       if (!Universe::release_fullgc_alot_dummy()) {
  97         warning("FullGCALot: Unable to release more dummies at bottom of heap");
  98       }
  99       HandleMark hm(thread);
 100       Universe::heap()->collect(GCCause::_full_gc_alot);
 101       unsigned int invocations = Universe::heap()->total_full_collections();
 102       // Compute new interval
 103       if (FullGCALotInterval > 1) {
 104         _fullgc_alot_counter = 1+(long)((double)FullGCALotInterval*os::random()/(max_jint+1.0));
 105         log_trace(gc)("Full gc no: %u\tInterval: %ld", invocations, _fullgc_alot_counter);


 106       } else {
 107         _fullgc_alot_counter = 1;
 108       }
 109       // Print progress message
 110       if (invocations % 100 == 0) {
 111         log_trace(gc)("Full gc no: %u", invocations);
 112       }
 113     } else {
 114       if (ScavengeALot) _scavenge_alot_counter--;
 115       // Check if we should force a scavenge
 116       if (_scavenge_alot_counter == 0) {
 117         HandleMark hm(thread);
 118         Universe::heap()->collect(GCCause::_scavenge_alot);
 119         unsigned int invocations = Universe::heap()->total_collections() - Universe::heap()->total_full_collections();
 120         // Compute new interval
 121         if (ScavengeALotInterval > 1) {
 122           _scavenge_alot_counter = 1+(long)((double)ScavengeALotInterval*os::random()/(max_jint+1.0));
 123           log_trace(gc)("Scavenge no: %u\tInterval: %ld", invocations, _scavenge_alot_counter);


 124         } else {
 125           _scavenge_alot_counter = 1;
 126         }
 127         // Print progress message
 128         if (invocations % 1000 == 0) {
 129           log_trace(gc)("Scavenge no: %u", invocations);
 130         }
 131       }
 132     }
 133   }
 134 }
 135 
 136 
 137 vframe* vframe_array[50];
 138 int walk_stack_counter = 0;
 139 
 140 void InterfaceSupport::walk_stack_from(vframe* start_vf) {
 141   // walk
 142   int i = 0;
 143   for (vframe* f = start_vf; f; f = f->sender() ) {
 144     if (i < 50) vframe_array[i++] = f;
 145   }
 146 }
 147 
 148 
 149 void InterfaceSupport::walk_stack() {


< prev index next >