8279573: compiler/codecache/CodeCacheFullCountTest.java fails with "RuntimeException: the value of full_count is wrong."
Reviewed-by: thartmann, eosterlund
This commit is contained in:
parent
31b61f982c
commit
76398c8400
@ -1238,9 +1238,9 @@ void CodeCache::report_codemem_full(int code_blob_type, bool print) {
|
|||||||
CodeHeap* heap = get_code_heap(code_blob_type);
|
CodeHeap* heap = get_code_heap(code_blob_type);
|
||||||
assert(heap != NULL, "heap is null");
|
assert(heap != NULL, "heap is null");
|
||||||
|
|
||||||
heap->report_full();
|
int full_count = heap->report_full();
|
||||||
|
|
||||||
if ((heap->full_count() == 1) || print) {
|
if ((full_count == 1) || print) {
|
||||||
// Not yet reported for this heap, report
|
// Not yet reported for this heap, report
|
||||||
if (SegmentedCodeCache) {
|
if (SegmentedCodeCache) {
|
||||||
ResourceMark rm;
|
ResourceMark rm;
|
||||||
@ -1277,7 +1277,7 @@ void CodeCache::report_codemem_full(int code_blob_type, bool print) {
|
|||||||
tty->print("%s", s.as_string());
|
tty->print("%s", s.as_string());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (heap->full_count() == 1) {
|
if (full_count == 1) {
|
||||||
if (PrintCodeHeapAnalytics) {
|
if (PrintCodeHeapAnalytics) {
|
||||||
CompileBroker::print_heapinfo(tty, "all", 4096); // details, may be a lot!
|
CompileBroker::print_heapinfo(tty, "all", 4096); // details, may be a lot!
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -28,6 +28,7 @@
|
|||||||
#include "code/codeBlob.hpp"
|
#include "code/codeBlob.hpp"
|
||||||
#include "memory/allocation.hpp"
|
#include "memory/allocation.hpp"
|
||||||
#include "memory/virtualspace.hpp"
|
#include "memory/virtualspace.hpp"
|
||||||
|
#include "runtime/atomic.hpp"
|
||||||
#include "utilities/macros.hpp"
|
#include "utilities/macros.hpp"
|
||||||
|
|
||||||
// Blocks
|
// Blocks
|
||||||
@ -216,7 +217,7 @@ class CodeHeap : public CHeapObj<mtCode> {
|
|||||||
int adapter_count() { return _adapter_count; }
|
int adapter_count() { return _adapter_count; }
|
||||||
void set_adapter_count(int count) { _adapter_count = count; }
|
void set_adapter_count(int count) { _adapter_count = count; }
|
||||||
int full_count() { return _full_count; }
|
int full_count() { return _full_count; }
|
||||||
void report_full() { _full_count++; }
|
int report_full() { return Atomic::add(&_full_count, 1); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
size_t heap_unallocated_capacity() const;
|
size_t heap_unallocated_capacity() const;
|
||||||
|
@ -55,7 +55,7 @@ public class CodeCacheFullCountTest {
|
|||||||
|
|
||||||
public static void runTest() throws Throwable {
|
public static void runTest() throws Throwable {
|
||||||
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(
|
||||||
"-XX:ReservedCodeCacheSize=2496k", "-XX:-UseCodeCacheFlushing", "CodeCacheFullCountTest", "WasteCodeCache");
|
"-XX:ReservedCodeCacheSize=2496k", "-XX:-UseCodeCacheFlushing", "-XX:-MethodFlushing", "CodeCacheFullCountTest", "WasteCodeCache");
|
||||||
OutputAnalyzer oa = ProcessTools.executeProcess(pb);
|
OutputAnalyzer oa = ProcessTools.executeProcess(pb);
|
||||||
oa.shouldHaveExitValue(0);
|
oa.shouldHaveExitValue(0);
|
||||||
String stdout = oa.getStdout();
|
String stdout = oa.getStdout();
|
||||||
@ -64,7 +64,7 @@ public class CodeCacheFullCountTest {
|
|||||||
Matcher stdoutMatcher = pattern.matcher(stdout);
|
Matcher stdoutMatcher = pattern.matcher(stdout);
|
||||||
if (stdoutMatcher.find()) {
|
if (stdoutMatcher.find()) {
|
||||||
int fullCount = Integer.parseInt(stdoutMatcher.group(1));
|
int fullCount = Integer.parseInt(stdoutMatcher.group(1));
|
||||||
if (fullCount != 1) {
|
if (fullCount == 0) {
|
||||||
throw new RuntimeException("the value of full_count is wrong.");
|
throw new RuntimeException("the value of full_count is wrong.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user