< prev index next >

src/share/vm/runtime/interfaceSupport.cpp

Print this page




  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         if (PrintGCDetails && Verbose) {
 105           tty->print_cr("Full gc no: %u\tInterval: %ld", invocations, _fullgc_alot_counter);
 106         }
 107       } else {
 108         _fullgc_alot_counter = 1;
 109       }
 110       // Print progress message
 111       if (invocations % 100 == 0) {
 112         if (PrintGCDetails && Verbose) tty->print_cr("Full gc no: %u", invocations);
 113       }
 114     } else {
 115       if (ScavengeALot) _scavenge_alot_counter--;
 116       // Check if we should force a scavenge
 117       if (_scavenge_alot_counter == 0) {
 118         HandleMark hm(thread);
 119         Universe::heap()->collect(GCCause::_scavenge_alot);
 120         unsigned int invocations = Universe::heap()->total_collections() - Universe::heap()->total_full_collections();
 121         // Compute new interval
 122         if (ScavengeALotInterval > 1) {
 123           _scavenge_alot_counter = 1+(long)((double)ScavengeALotInterval*os::random()/(max_jint+1.0));
 124           if (PrintGCDetails && Verbose) {
 125             tty->print_cr("Scavenge no: %u\tInterval: %ld", invocations, _scavenge_alot_counter);
 126           }
 127         } else {
 128           _scavenge_alot_counter = 1;
 129         }
 130         // Print progress message
 131         if (invocations % 1000 == 0) {
 132           if (PrintGCDetails && Verbose) tty->print_cr("Scavenge no: %u", invocations);
 133         }
 134       }
 135     }
 136   }
 137 }
 138 
 139 
 140 vframe* vframe_array[50];
 141 int walk_stack_counter = 0;
 142 
 143 void InterfaceSupport::walk_stack_from(vframe* start_vf) {
 144   // walk
 145   int i = 0;
 146   for (vframe* f = start_vf; f; f = f->sender() ) {
 147     if (i < 50) vframe_array[i++] = f;
 148   }
 149 }
 150 
 151 
 152 void InterfaceSupport::walk_stack() {




  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 
 139 void InterfaceSupport::walk_stack_from(vframe* start_vf) {
 140   // walk
 141   int i = 0;
 142   for (vframe* f = start_vf; f; f = f->sender() ) {
 143     if (i < 50) vframe_array[i++] = f;
 144   }
 145 }
 146 
 147 
 148 void InterfaceSupport::walk_stack() {


< prev index next >