Print this page


Split Split Close
Expand all
Collapse all
          --- old/src/share/vm/memory/universe.cpp
          +++ new/src/share/vm/memory/universe.cpp
↓ open down ↓ 1095 lines elided ↑ open up ↑
1096 1096  
1097 1097  void Universe::print_heap_after_gc() {
1098 1098    LogHandle(gc, heap) log;
1099 1099    if (log.is_trace()) {
1100 1100      log.trace("Heap after GC invocations=%u (full %u):", heap()->total_collections(), heap()->total_full_collections());
1101 1101      ResourceMark rm;
1102 1102      heap()->print_on(log.trace_stream());
1103 1103    }
1104 1104  }
1105 1105  
     1106 +bool Universe::should_verify_subset(const char* subset) {
     1107 +  if (VerifySubSet == NULL || VerifySubSet[0] == '\0') {
     1108 +    // VerifySubSet is not specified, verify everything
     1109 +    return true;
     1110 +  }
     1111 +  if (strstr(VerifySubSet, subset)) {
     1112 +    return true;
     1113 +  }
     1114 +  return false;
     1115 +}
     1116 +
1106 1117  void Universe::verify(VerifyOption option, const char* prefix) {
1107 1118    // The use of _verify_in_progress is a temporary work around for
1108 1119    // 6320749.  Don't bother with a creating a class to set and clear
1109 1120    // it since it is only used in this method and the control flow is
1110 1121    // straight forward.
1111 1122    _verify_in_progress = true;
1112 1123  
1113 1124    COMPILER2_PRESENT(
1114 1125      assert(!DerivedPointerTable::is_active(),
1115 1126           "DPT should not be active during verification "
1116 1127           "(of thread stacks below)");
1117 1128    )
1118 1129  
1119 1130    ResourceMark rm;
1120 1131    HandleMark hm;  // Handles created during verification can be zapped
1121 1132    _verify_count++;
1122 1133  
1123 1134    FormatBuffer<> title("Verifying %s", prefix);
1124 1135    GCTraceTime(Info, gc, verify) tm(title.buffer());
1125      -  log_debug(gc, verify)("Threads");
1126      -  Threads::verify();
1127      -  log_debug(gc, verify)("Heap");
1128      -  heap()->verify(option);
1129      -  log_debug(gc, verify)("SymbolTable");
1130      -  SymbolTable::verify();
1131      -  log_debug(gc, verify)("StringTable");
1132      -  StringTable::verify();
     1136 +  if (should_verify_subset("threads")) {
     1137 +    log_debug(gc, verify)("Threads");
     1138 +    Threads::verify();
     1139 +  }
     1140 +  if (should_verify_subset("heap")) {
     1141 +    log_debug(gc, verify)("Heap");
     1142 +    heap()->verify(option);
     1143 +  }
     1144 +  if (should_verify_subset("symbol_table")) {
     1145 +    log_debug(gc, verify)("SymbolTable");
     1146 +    SymbolTable::verify();
     1147 +  }
     1148 +  if (should_verify_subset("string_table")) {
     1149 +    log_debug(gc, verify)("StringTable");
     1150 +    StringTable::verify();
     1151 +  }
     1152 +  if (should_verify_subset("codecache")) {
1133 1153    {
1134 1154      MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
1135 1155      log_debug(gc, verify)("CodeCache");
1136 1156      CodeCache::verify();
1137 1157    }
1138      -  log_debug(gc, verify)("SystemDictionary");
1139      -  SystemDictionary::verify();
     1158 +  }
     1159 +  if (should_verify_subset("dictionary")) {
     1160 +    log_debug(gc, verify)("SystemDictionary");
     1161 +    SystemDictionary::verify();
     1162 +  }
1140 1163  #ifndef PRODUCT
1141      -  log_debug(gc, verify)("ClassLoaderDataGraph");
1142      -  ClassLoaderDataGraph::verify();
     1164 +  if (should_verify_subset("classloader_data_graph")) {
     1165 +    log_debug(gc, verify)("ClassLoaderDataGraph");
     1166 +    ClassLoaderDataGraph::verify();
     1167 +  }
1143 1168  #endif
1144      -  log_debug(gc, verify)("MetaspaceAux");
1145      -  MetaspaceAux::verify_free_chunks();
1146      -  log_debug(gc, verify)("JNIHandles");
1147      -  JNIHandles::verify();
1148      -  log_debug(gc, verify)("C-heap");
1149      -  os::check_heap();
1150      -  log_debug(gc, verify)("CodeCache Oops");
1151      -  CodeCache::verify_oops();
     1169 +  if (should_verify_subset("metaspace")) {
     1170 +    log_debug(gc, verify)("MetaspaceAux");
     1171 +    MetaspaceAux::verify_free_chunks();
     1172 +  }
     1173 +  if (should_verify_subset("jni_handles")) {
     1174 +    log_debug(gc, verify)("JNIHandles");
     1175 +    JNIHandles::verify();
     1176 +  }
     1177 +  if (should_verify_subset("c-heap")) {
     1178 +    log_debug(gc, verify)("C-heap");
     1179 +    os::check_heap();
     1180 +  }
     1181 +  if (should_verify_subset("codecache_oops")) {
     1182 +    log_debug(gc, verify)("CodeCache Oops");
     1183 +    CodeCache::verify_oops();
     1184 +  }
1152 1185  
1153 1186    _verify_in_progress = false;
1154 1187  }
1155 1188  
1156 1189  
1157 1190  #ifndef PRODUCT
1158 1191  void Universe::calculate_verify_data(HeapWord* low_boundary, HeapWord* high_boundary) {
1159 1192    assert(low_boundary < high_boundary, "bad interval");
1160 1193  
1161 1194    // decide which low-order bits we require to be clear:
↓ open down ↓ 109 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX