< prev index next >

src/hotspot/share/code/codeCache.cpp

Print this page




1267 
1268       log_warning(codecache)("%s", msg1);
1269       log_warning(codecache)("%s", msg2);
1270       warning("%s", msg1);
1271       warning("%s", msg2);
1272     }
1273     ResourceMark rm;
1274     stringStream s;
1275     // Dump code cache into a buffer before locking the tty.
1276     {
1277       MutexLocker mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
1278       print_summary(&s);
1279     }
1280     {
1281       ttyLocker ttyl;
1282       tty->print("%s", s.as_string());
1283     }
1284 
1285     if (heap->full_count() == 0) {
1286       if (PrintCodeHeapAnalytics) {
1287         CompileBroker::print_heapinfo(tty, "all", 4096); // details, may be a lot!
1288       }
1289     }
1290   }
1291 
1292   heap->report_full();
1293 
1294   EventCodeCacheFull event;
1295   if (event.should_commit()) {
1296     event.set_codeBlobType((u1)code_blob_type);
1297     event.set_startAddress((u8)heap->low_boundary());
1298     event.set_commitedTopAddress((u8)heap->high());
1299     event.set_reservedTopAddress((u8)heap->high_boundary());
1300     event.set_entryCount(heap->blob_count());
1301     event.set_methodCount(heap->nmethod_count());
1302     event.set_adaptorCount(heap->adapter_count());
1303     event.set_unallocatedCapacity(heap->unallocated_capacity());
1304     event.set_fullCount(heap->full_count());
1305     event.commit();
1306   }
1307 }


1554                  method_name,
1555                  (intptr_t)cm->header_begin(), (intptr_t)cm->code_begin(), (intptr_t)cm->code_end());
1556   }
1557 }
1558 
1559 void CodeCache::print_layout(outputStream* st) {
1560   MutexLocker mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
1561   ResourceMark rm;
1562   print_summary(st, true);
1563 }
1564 
1565 void CodeCache::log_state(outputStream* st) {
1566   st->print(" total_blobs='" UINT32_FORMAT "' nmethods='" UINT32_FORMAT "'"
1567             " adapters='" UINT32_FORMAT "' free_code_cache='" SIZE_FORMAT "'",
1568             blob_count(), nmethod_count(), adapter_count(),
1569             unallocated_capacity());
1570 }
1571 
1572 //---<  BEGIN  >--- CodeHeap State Analytics.
1573 
1574 void CodeCache::aggregate(outputStream *out, size_t granularity) {
1575   FOR_ALL_ALLOCABLE_HEAPS(heap) {
1576     CodeHeapState::aggregate(out, (*heap), granularity);
1577   }
1578 }
1579 
1580 void CodeCache::discard(outputStream *out) {
1581   FOR_ALL_ALLOCABLE_HEAPS(heap) {
1582     CodeHeapState::discard(out, (*heap));
1583   }
1584 }
1585 
1586 void CodeCache::print_usedSpace(outputStream *out) {
1587   FOR_ALL_ALLOCABLE_HEAPS(heap) {
1588     CodeHeapState::print_usedSpace(out, (*heap));
1589   }
1590 }
1591 
1592 void CodeCache::print_freeSpace(outputStream *out) {
1593   FOR_ALL_ALLOCABLE_HEAPS(heap) {
1594     CodeHeapState::print_freeSpace(out, (*heap));




1267 
1268       log_warning(codecache)("%s", msg1);
1269       log_warning(codecache)("%s", msg2);
1270       warning("%s", msg1);
1271       warning("%s", msg2);
1272     }
1273     ResourceMark rm;
1274     stringStream s;
1275     // Dump code cache into a buffer before locking the tty.
1276     {
1277       MutexLocker mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
1278       print_summary(&s);
1279     }
1280     {
1281       ttyLocker ttyl;
1282       tty->print("%s", s.as_string());
1283     }
1284 
1285     if (heap->full_count() == 0) {
1286       if (PrintCodeHeapAnalytics) {
1287         CompileBroker::print_heapinfo(tty, "all", "4096"); // details, may be a lot!
1288       }
1289     }
1290   }
1291 
1292   heap->report_full();
1293 
1294   EventCodeCacheFull event;
1295   if (event.should_commit()) {
1296     event.set_codeBlobType((u1)code_blob_type);
1297     event.set_startAddress((u8)heap->low_boundary());
1298     event.set_commitedTopAddress((u8)heap->high());
1299     event.set_reservedTopAddress((u8)heap->high_boundary());
1300     event.set_entryCount(heap->blob_count());
1301     event.set_methodCount(heap->nmethod_count());
1302     event.set_adaptorCount(heap->adapter_count());
1303     event.set_unallocatedCapacity(heap->unallocated_capacity());
1304     event.set_fullCount(heap->full_count());
1305     event.commit();
1306   }
1307 }


1554                  method_name,
1555                  (intptr_t)cm->header_begin(), (intptr_t)cm->code_begin(), (intptr_t)cm->code_end());
1556   }
1557 }
1558 
1559 void CodeCache::print_layout(outputStream* st) {
1560   MutexLocker mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
1561   ResourceMark rm;
1562   print_summary(st, true);
1563 }
1564 
1565 void CodeCache::log_state(outputStream* st) {
1566   st->print(" total_blobs='" UINT32_FORMAT "' nmethods='" UINT32_FORMAT "'"
1567             " adapters='" UINT32_FORMAT "' free_code_cache='" SIZE_FORMAT "'",
1568             blob_count(), nmethod_count(), adapter_count(),
1569             unallocated_capacity());
1570 }
1571 
1572 //---<  BEGIN  >--- CodeHeap State Analytics.
1573 
1574 void CodeCache::aggregate(outputStream *out, const char* granularity) {
1575   FOR_ALL_ALLOCABLE_HEAPS(heap) {
1576     CodeHeapState::aggregate(out, (*heap), granularity);
1577   }
1578 }
1579 
1580 void CodeCache::discard(outputStream *out) {
1581   FOR_ALL_ALLOCABLE_HEAPS(heap) {
1582     CodeHeapState::discard(out, (*heap));
1583   }
1584 }
1585 
1586 void CodeCache::print_usedSpace(outputStream *out) {
1587   FOR_ALL_ALLOCABLE_HEAPS(heap) {
1588     CodeHeapState::print_usedSpace(out, (*heap));
1589   }
1590 }
1591 
1592 void CodeCache::print_freeSpace(outputStream *out) {
1593   FOR_ALL_ALLOCABLE_HEAPS(heap) {
1594     CodeHeapState::print_freeSpace(out, (*heap));


< prev index next >