< prev index next >

src/share/vm/runtime/interfaceSupport.cpp

Print this page




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




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


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


 128         } else {
 129           _scavenge_alot_counter = 1;
 130         }
 131         // Print progress message
 132         if (invocations % 1000 == 0) {
 133           log_trace(gc)("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() {


< prev index next >