8172286: CodeCacheFlushing message should be shown in UL

Reviewed-by: kvn
This commit is contained in:
Yasumasa Suenaga 2017-02-14 19:16:46 -08:00
parent 2fc76e8a55
commit 5a06c21978
3 changed files with 31 additions and 4 deletions

View file

@ -1309,6 +1309,8 @@ void CodeCache::verify() {
}
// A CodeHeap is full. Print out warning and report event.
PRAGMA_DIAG_PUSH
PRAGMA_FORMAT_NONLITERAL_IGNORED
void CodeCache::report_codemem_full(int code_blob_type, bool print) {
// Get nmethod heap for the given CodeBlobType and build CodeCacheFull event
CodeHeap* heap = get_code_heap(code_blob_type);
@ -1317,11 +1319,27 @@ void CodeCache::report_codemem_full(int code_blob_type, bool print) {
if ((heap->full_count() == 0) || print) {
// Not yet reported for this heap, report
if (SegmentedCodeCache) {
warning("%s is full. Compiler has been disabled.", get_code_heap_name(code_blob_type));
warning("Try increasing the code heap size using -XX:%s=", get_code_heap_flag_name(code_blob_type));
ResourceMark rm;
stringStream msg1_stream, msg2_stream;
msg1_stream.print("%s is full. Compiler has been disabled.",
get_code_heap_name(code_blob_type));
msg2_stream.print("Try increasing the code heap size using -XX:%s=",
get_code_heap_flag_name(code_blob_type));
const char *msg1 = msg1_stream.as_string();
const char *msg2 = msg2_stream.as_string();
log_warning(codecache)(msg1);
log_warning(codecache)(msg2);
warning(msg1);
warning(msg2);
} else {
warning("CodeCache is full. Compiler has been disabled.");
warning("Try increasing the code cache size using -XX:ReservedCodeCacheSize=");
const char *msg1 = "CodeCache is full. Compiler has been disabled.";
const char *msg2 = "Try increasing the code cache size using -XX:ReservedCodeCacheSize=";
log_warning(codecache)(msg1);
log_warning(codecache)(msg2);
warning(msg1);
warning(msg2);
}
ResourceMark rm;
stringStream s;
@ -1350,6 +1368,7 @@ void CodeCache::report_codemem_full(int code_blob_type, bool print) {
event.commit();
}
}
PRAGMA_DIAG_POP
void CodeCache::print_memory_overhead() {
size_t wasted_bytes = 0;