mirror of
https://github.com/openjdk/jdk.git
synced 2026-05-11 14:11:36 +00:00
8246404: ZGC: Use GCLogPrecious for important logging lines
Reviewed-by: sjohanss, pliden, eosterlund
This commit is contained in:
parent
5fc89b6e72
commit
a180444c6f
@ -22,6 +22,7 @@
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "gc/shared/gcLogPrecious.hpp"
|
||||
#include "gc/z/zErrno.hpp"
|
||||
#include "gc/z/zGlobals.hpp"
|
||||
#include "gc/z/zLargePages.inline.hpp"
|
||||
@ -81,7 +82,7 @@ ZPhysicalMemoryBacking::ZPhysicalMemoryBacking() :
|
||||
_base = (uintptr_t)os::reserve_memory(MaxHeapSize);
|
||||
if (_base == 0) {
|
||||
// Failed
|
||||
log_error(gc)("Failed to reserve address space for backing memory");
|
||||
log_error_p(gc)("Failed to reserve address space for backing memory");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -22,11 +22,11 @@
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "gc/shared/gcLogPrecious.hpp"
|
||||
#include "gc/z/zArray.inline.hpp"
|
||||
#include "gc/z/zErrno.hpp"
|
||||
#include "gc/z/zMountPoint_linux.hpp"
|
||||
#include "runtime/globals.hpp"
|
||||
#include "logging/log.hpp"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
@ -73,7 +73,7 @@ void ZMountPoint::get_mountpoints(const char* filesystem, ZArray<char*>* mountpo
|
||||
FILE* fd = fopen(PROC_SELF_MOUNTINFO, "r");
|
||||
if (fd == NULL) {
|
||||
ZErrno err;
|
||||
log_error(gc)("Failed to open %s: %s", PROC_SELF_MOUNTINFO, err.to_string());
|
||||
log_error_p(gc)("Failed to open %s: %s", PROC_SELF_MOUNTINFO, err.to_string());
|
||||
return;
|
||||
}
|
||||
|
||||
@ -114,10 +114,10 @@ char* ZMountPoint::find_preferred_mountpoint(const char* filesystem,
|
||||
}
|
||||
|
||||
// Preferred mount point not found
|
||||
log_error(gc)("More than one %s filesystem found:", filesystem);
|
||||
log_error_p(gc)("More than one %s filesystem found:", filesystem);
|
||||
ZArrayIterator<char*> iter2(mountpoints);
|
||||
for (char* mountpoint; iter2.next(&mountpoint);) {
|
||||
log_error(gc)(" %s", mountpoint);
|
||||
log_error_p(gc)(" %s", mountpoint);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@ -131,7 +131,7 @@ char* ZMountPoint::find_mountpoint(const char* filesystem, const char** preferre
|
||||
|
||||
if (mountpoints.size() == 0) {
|
||||
// No mount point found
|
||||
log_error(gc)("Failed to find an accessible %s filesystem", filesystem);
|
||||
log_error_p(gc)("Failed to find an accessible %s filesystem", filesystem);
|
||||
} else if (mountpoints.size() == 1) {
|
||||
// One mount point found
|
||||
path = strdup(mountpoints.at(0));
|
||||
|
||||
@ -22,6 +22,7 @@
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "gc/shared/gcLogPrecious.hpp"
|
||||
#include "gc/z/zArray.inline.hpp"
|
||||
#include "gc/z/zErrno.hpp"
|
||||
#include "gc/z/zGlobals.hpp"
|
||||
@ -130,7 +131,7 @@ ZPhysicalMemoryBacking::ZPhysicalMemoryBacking() :
|
||||
struct statfs buf;
|
||||
if (fstatfs(_fd, &buf) == -1) {
|
||||
ZErrno err;
|
||||
log_error(gc)("Failed to determine filesystem type for backing file (%s)", err.to_string());
|
||||
log_error_p(gc)("Failed to determine filesystem type for backing file (%s)", err.to_string());
|
||||
return;
|
||||
}
|
||||
|
||||
@ -138,50 +139,50 @@ ZPhysicalMemoryBacking::ZPhysicalMemoryBacking() :
|
||||
_block_size = buf.f_bsize;
|
||||
_available = buf.f_bavail * _block_size;
|
||||
|
||||
log_info(gc, init)("Heap Backing Filesystem: %s (0x" UINT64_FORMAT_X ")",
|
||||
is_tmpfs() ? ZFILESYSTEM_TMPFS : is_hugetlbfs() ? ZFILESYSTEM_HUGETLBFS : "other", _filesystem);
|
||||
log_info_p(gc, init)("Heap Backing Filesystem: %s (0x" UINT64_FORMAT_X ")",
|
||||
is_tmpfs() ? ZFILESYSTEM_TMPFS : is_hugetlbfs() ? ZFILESYSTEM_HUGETLBFS : "other", _filesystem);
|
||||
|
||||
// Make sure the filesystem type matches requested large page type
|
||||
if (ZLargePages::is_transparent() && !is_tmpfs()) {
|
||||
log_error(gc)("-XX:+UseTransparentHugePages can only be enabled when using a %s filesystem",
|
||||
ZFILESYSTEM_TMPFS);
|
||||
log_error_p(gc)("-XX:+UseTransparentHugePages can only be enabled when using a %s filesystem",
|
||||
ZFILESYSTEM_TMPFS);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ZLargePages::is_transparent() && !tmpfs_supports_transparent_huge_pages()) {
|
||||
log_error(gc)("-XX:+UseTransparentHugePages on a %s filesystem not supported by kernel",
|
||||
ZFILESYSTEM_TMPFS);
|
||||
log_error_p(gc)("-XX:+UseTransparentHugePages on a %s filesystem not supported by kernel",
|
||||
ZFILESYSTEM_TMPFS);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ZLargePages::is_explicit() && !is_hugetlbfs()) {
|
||||
log_error(gc)("-XX:+UseLargePages (without -XX:+UseTransparentHugePages) can only be enabled "
|
||||
"when using a %s filesystem", ZFILESYSTEM_HUGETLBFS);
|
||||
log_error_p(gc)("-XX:+UseLargePages (without -XX:+UseTransparentHugePages) can only be enabled "
|
||||
"when using a %s filesystem", ZFILESYSTEM_HUGETLBFS);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!ZLargePages::is_explicit() && is_hugetlbfs()) {
|
||||
log_error(gc)("-XX:+UseLargePages must be enabled when using a %s filesystem",
|
||||
ZFILESYSTEM_HUGETLBFS);
|
||||
log_error_p(gc)("-XX:+UseLargePages must be enabled when using a %s filesystem",
|
||||
ZFILESYSTEM_HUGETLBFS);
|
||||
return;
|
||||
}
|
||||
|
||||
if (ZLargePages::is_explicit() && os::large_page_size() != ZGranuleSize) {
|
||||
log_error(gc)("Incompatible large page size configured " SIZE_FORMAT " (expected " SIZE_FORMAT ")",
|
||||
os::large_page_size(), ZGranuleSize);
|
||||
log_error_p(gc)("Incompatible large page size configured " SIZE_FORMAT " (expected " SIZE_FORMAT ")",
|
||||
os::large_page_size(), ZGranuleSize);
|
||||
return;
|
||||
}
|
||||
|
||||
// Make sure the filesystem block size is compatible
|
||||
if (ZGranuleSize % _block_size != 0) {
|
||||
log_error(gc)("Filesystem backing the heap has incompatible block size (" SIZE_FORMAT ")",
|
||||
_block_size);
|
||||
log_error_p(gc)("Filesystem backing the heap has incompatible block size (" SIZE_FORMAT ")",
|
||||
_block_size);
|
||||
return;
|
||||
}
|
||||
|
||||
if (is_hugetlbfs() && _block_size != ZGranuleSize) {
|
||||
log_error(gc)("%s filesystem has unexpected block size " SIZE_FORMAT " (expected " SIZE_FORMAT ")",
|
||||
ZFILESYSTEM_HUGETLBFS, _block_size, ZGranuleSize);
|
||||
log_error_p(gc)("%s filesystem has unexpected block size " SIZE_FORMAT " (expected " SIZE_FORMAT ")",
|
||||
ZFILESYSTEM_HUGETLBFS, _block_size, ZGranuleSize);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -199,12 +200,12 @@ int ZPhysicalMemoryBacking::create_mem_fd(const char* name) const {
|
||||
const int fd = ZSyscall::memfd_create(filename, MFD_CLOEXEC | extra_flags);
|
||||
if (fd == -1) {
|
||||
ZErrno err;
|
||||
log_debug(gc, init)("Failed to create memfd file (%s)",
|
||||
((ZLargePages::is_explicit() && err == EINVAL) ? "Hugepages not supported" : err.to_string()));
|
||||
log_debug_p(gc, init)("Failed to create memfd file (%s)",
|
||||
((ZLargePages::is_explicit() && err == EINVAL) ? "Hugepages not supported" : err.to_string()));
|
||||
return -1;
|
||||
}
|
||||
|
||||
log_info(gc, init)("Heap Backing File: /memfd:%s", filename);
|
||||
log_info_p(gc, init)("Heap Backing File: /memfd:%s", filename);
|
||||
|
||||
return fd;
|
||||
}
|
||||
@ -220,7 +221,7 @@ int ZPhysicalMemoryBacking::create_file_fd(const char* name) const {
|
||||
// Find mountpoint
|
||||
ZMountPoint mountpoint(filesystem, preferred_mountpoints);
|
||||
if (mountpoint.get() == NULL) {
|
||||
log_error(gc)("Use -XX:AllocateHeapAt to specify the path to a %s filesystem", filesystem);
|
||||
log_error_p(gc)("Use -XX:AllocateHeapAt to specify the path to a %s filesystem", filesystem);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -229,23 +230,23 @@ int ZPhysicalMemoryBacking::create_file_fd(const char* name) const {
|
||||
const int fd_anon = os::open(mountpoint.get(), O_TMPFILE|O_EXCL|O_RDWR|O_CLOEXEC, S_IRUSR|S_IWUSR);
|
||||
if (fd_anon == -1) {
|
||||
ZErrno err;
|
||||
log_debug(gc, init)("Failed to create anonymous file in %s (%s)", mountpoint.get(),
|
||||
(err == EINVAL ? "Not supported" : err.to_string()));
|
||||
log_debug_p(gc, init)("Failed to create anonymous file in %s (%s)", mountpoint.get(),
|
||||
(err == EINVAL ? "Not supported" : err.to_string()));
|
||||
} else {
|
||||
// Get inode number for anonymous file
|
||||
struct stat stat_buf;
|
||||
if (fstat(fd_anon, &stat_buf) == -1) {
|
||||
ZErrno err;
|
||||
log_error(gc)("Failed to determine inode number for anonymous file (%s)", err.to_string());
|
||||
log_error_p(gc)("Failed to determine inode number for anonymous file (%s)", err.to_string());
|
||||
return -1;
|
||||
}
|
||||
|
||||
log_info(gc, init)("Heap Backing File: %s/#" UINT64_FORMAT, mountpoint.get(), (uint64_t)stat_buf.st_ino);
|
||||
log_info_p(gc, init)("Heap Backing File: %s/#" UINT64_FORMAT, mountpoint.get(), (uint64_t)stat_buf.st_ino);
|
||||
|
||||
return fd_anon;
|
||||
}
|
||||
|
||||
log_debug(gc, init)("Falling back to open/unlink");
|
||||
log_debug_p(gc, init)("Falling back to open/unlink");
|
||||
|
||||
// Create file name
|
||||
char filename[PATH_MAX];
|
||||
@ -255,18 +256,18 @@ int ZPhysicalMemoryBacking::create_file_fd(const char* name) const {
|
||||
const int fd = os::open(filename, O_CREAT|O_EXCL|O_RDWR|O_CLOEXEC, S_IRUSR|S_IWUSR);
|
||||
if (fd == -1) {
|
||||
ZErrno err;
|
||||
log_error(gc)("Failed to create file %s (%s)", filename, err.to_string());
|
||||
log_error_p(gc)("Failed to create file %s (%s)", filename, err.to_string());
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Unlink file
|
||||
if (unlink(filename) == -1) {
|
||||
ZErrno err;
|
||||
log_error(gc)("Failed to unlink file %s (%s)", filename, err.to_string());
|
||||
log_error_p(gc)("Failed to unlink file %s (%s)", filename, err.to_string());
|
||||
return -1;
|
||||
}
|
||||
|
||||
log_info(gc, init)("Heap Backing File: %s", filename);
|
||||
log_info_p(gc, init)("Heap Backing File: %s", filename);
|
||||
|
||||
return fd;
|
||||
}
|
||||
@ -283,7 +284,7 @@ int ZPhysicalMemoryBacking::create_fd(const char* name) const {
|
||||
return fd;
|
||||
}
|
||||
|
||||
log_debug(gc, init)("Falling back to searching for an accessible mount point");
|
||||
log_debug_p(gc)("Falling back to searching for an accessible mount point");
|
||||
}
|
||||
|
||||
return create_file_fd(name);
|
||||
@ -298,23 +299,23 @@ void ZPhysicalMemoryBacking::warn_available_space(size_t max) const {
|
||||
// will be zero if no size limit was specified when it was mounted.
|
||||
if (_available == 0) {
|
||||
// No size limit set, skip check
|
||||
log_info(gc, init)("Available space on backing filesystem: N/A");
|
||||
log_info_p(gc, init)("Available space on backing filesystem: N/A");
|
||||
return;
|
||||
}
|
||||
|
||||
log_info(gc, init)("Available space on backing filesystem: " SIZE_FORMAT "M", _available / M);
|
||||
log_info_p(gc, init)("Available space on backing filesystem: " SIZE_FORMAT "M", _available / M);
|
||||
|
||||
// Warn if the filesystem doesn't currently have enough space available to hold
|
||||
// the max heap size. The max heap size will be capped if we later hit this limit
|
||||
// when trying to expand the heap.
|
||||
if (_available < max) {
|
||||
log_warning(gc)("***** WARNING! INCORRECT SYSTEM CONFIGURATION DETECTED! *****");
|
||||
log_warning(gc)("Not enough space available on the backing filesystem to hold the current max Java heap");
|
||||
log_warning(gc)("size (" SIZE_FORMAT "M). Please adjust the size of the backing filesystem accordingly "
|
||||
log_warning_p(gc)("***** WARNING! INCORRECT SYSTEM CONFIGURATION DETECTED! *****");
|
||||
log_warning_p(gc)("Not enough space available on the backing filesystem to hold the current max Java heap");
|
||||
log_warning_p(gc)("size (" SIZE_FORMAT "M). Please adjust the size of the backing filesystem accordingly "
|
||||
"(available", max / M);
|
||||
log_warning(gc)("space is currently " SIZE_FORMAT "M). Continuing execution with the current filesystem "
|
||||
log_warning_p(gc)("space is currently " SIZE_FORMAT "M). Continuing execution with the current filesystem "
|
||||
"size could", _available / M);
|
||||
log_warning(gc)("lead to a premature OutOfMemoryError being thrown, due to failure to map memory.");
|
||||
log_warning_p(gc)("lead to a premature OutOfMemoryError being thrown, due to failure to map memory.");
|
||||
}
|
||||
}
|
||||
|
||||
@ -323,7 +324,7 @@ void ZPhysicalMemoryBacking::warn_max_map_count(size_t max) const {
|
||||
FILE* const file = fopen(filename, "r");
|
||||
if (file == NULL) {
|
||||
// Failed to open file, skip check
|
||||
log_debug(gc, init)("Failed to open %s", filename);
|
||||
log_debug_p(gc, init)("Failed to open %s", filename);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -332,7 +333,7 @@ void ZPhysicalMemoryBacking::warn_max_map_count(size_t max) const {
|
||||
fclose(file);
|
||||
if (result != 1) {
|
||||
// Failed to read file, skip check
|
||||
log_debug(gc, init)("Failed to read %s", filename);
|
||||
log_debug_p(gc, init)("Failed to read %s", filename);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -343,13 +344,13 @@ void ZPhysicalMemoryBacking::warn_max_map_count(size_t max) const {
|
||||
// We speculate that we need another 20% to allow for non-ZGC subsystems to map memory.
|
||||
const size_t required_max_map_count = (max / ZGranuleSize) * 3 * 1.2;
|
||||
if (actual_max_map_count < required_max_map_count) {
|
||||
log_warning(gc)("***** WARNING! INCORRECT SYSTEM CONFIGURATION DETECTED! *****");
|
||||
log_warning(gc)("The system limit on number of memory mappings per process might be too low for the given");
|
||||
log_warning(gc)("max Java heap size (" SIZE_FORMAT "M). Please adjust %s to allow for at",
|
||||
log_warning_p(gc)("***** WARNING! INCORRECT SYSTEM CONFIGURATION DETECTED! *****");
|
||||
log_warning_p(gc)("The system limit on number of memory mappings per process might be too low for the given");
|
||||
log_warning_p(gc)("max Java heap size (" SIZE_FORMAT "M). Please adjust %s to allow for at",
|
||||
max / M, filename);
|
||||
log_warning(gc)("least " SIZE_FORMAT " mappings (current limit is " SIZE_FORMAT "). Continuing execution "
|
||||
log_warning_p(gc)("least " SIZE_FORMAT " mappings (current limit is " SIZE_FORMAT "). Continuing execution "
|
||||
"with the current", required_max_map_count, actual_max_map_count);
|
||||
log_warning(gc)("limit could lead to a fatal error, due to failure to map memory.");
|
||||
log_warning_p(gc)("limit could lead to a fatal error, due to failure to map memory.");
|
||||
}
|
||||
}
|
||||
|
||||
@ -564,7 +565,7 @@ ZErrno ZPhysicalMemoryBacking::fallocate_fill_hole(size_t offset, size_t length)
|
||||
}
|
||||
|
||||
// Not supported
|
||||
log_debug(gc)("Falling back to fallocate() compatibility mode");
|
||||
log_debug_p(gc)("Falling back to fallocate() compatibility mode");
|
||||
z_fallocate_supported = false;
|
||||
}
|
||||
|
||||
@ -645,7 +646,7 @@ retry:
|
||||
// will fail, since there is a delay between process termination and the
|
||||
// huge pages owned by that process being returned to the huge page pool
|
||||
// and made available for new allocations.
|
||||
log_debug(gc, init)("Failed to commit memory (%s), retrying", err.to_string());
|
||||
log_debug_p(gc, init)("Failed to commit memory (%s), retrying", err.to_string());
|
||||
|
||||
// Wait and retry in one second, in the hope that huge pages will be
|
||||
// available by then.
|
||||
@ -654,7 +655,7 @@ retry:
|
||||
}
|
||||
|
||||
// Failed
|
||||
log_error(gc)("Failed to commit memory (%s)", err.to_string());
|
||||
log_error_p(gc)("Failed to commit memory (%s)", err.to_string());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -22,8 +22,8 @@
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "gc/shared/gcLogPrecious.hpp"
|
||||
#include "gc/z/zSyscall_windows.hpp"
|
||||
#include "logging/log.hpp"
|
||||
#include "runtime/java.hpp"
|
||||
#include "runtime/os.hpp"
|
||||
|
||||
@ -38,13 +38,13 @@ static void lookup_symbol(Fn*& fn, const char* library, const char* symbol) {
|
||||
char ebuf[1024];
|
||||
void* const handle = os::dll_load(library, ebuf, sizeof(ebuf));
|
||||
if (handle == NULL) {
|
||||
log_error(gc)("Failed to load library: %s", library);
|
||||
log_error_p(gc)("Failed to load library: %s", library);
|
||||
vm_exit_during_initialization("ZGC requires Windows version 1803 or later");
|
||||
}
|
||||
|
||||
fn = reinterpret_cast<Fn*>(os::dll_lookup(handle, symbol));
|
||||
if (fn == NULL) {
|
||||
log_error(gc)("Failed to lookup symbol: %s", symbol);
|
||||
log_error_p(gc)("Failed to lookup symbol: %s", symbol);
|
||||
vm_exit_during_initialization("ZGC requires Windows version 1803 or later");
|
||||
}
|
||||
}
|
||||
|
||||
@ -22,8 +22,8 @@
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "gc/shared/gcLogPrecious.hpp"
|
||||
#include "gc/z/zCPU.inline.hpp"
|
||||
#include "logging/log.hpp"
|
||||
#include "memory/padded.inline.hpp"
|
||||
#include "runtime/os.hpp"
|
||||
#include "runtime/thread.inline.hpp"
|
||||
@ -46,9 +46,9 @@ void ZCPU::initialize() {
|
||||
_affinity[i]._thread = ZCPU_UNKNOWN_AFFINITY;
|
||||
}
|
||||
|
||||
log_info(gc, init)("CPUs: %u total, %u available",
|
||||
os::processor_count(),
|
||||
os::initial_active_processor_count());
|
||||
log_info_p(gc, init)("CPUs: %u total, %u available",
|
||||
os::processor_count(),
|
||||
os::initial_active_processor_count());
|
||||
}
|
||||
|
||||
uint32_t ZCPU::id_slow() {
|
||||
|
||||
@ -22,10 +22,10 @@
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "gc/shared/gcLogPrecious.hpp"
|
||||
#include "gc/z/zCPU.inline.hpp"
|
||||
#include "gc/z/zGlobals.hpp"
|
||||
#include "gc/z/zHeuristics.hpp"
|
||||
#include "logging/log.hpp"
|
||||
#include "runtime/globals.hpp"
|
||||
#include "runtime/os.hpp"
|
||||
#include "utilities/globalDefinitions.hpp"
|
||||
@ -50,9 +50,9 @@ void ZHeuristics::set_medium_page_size() {
|
||||
ZObjectAlignmentMediumShift = (int)ZPageSizeMediumShift - 13;
|
||||
ZObjectAlignmentMedium = 1 << ZObjectAlignmentMediumShift;
|
||||
|
||||
log_info(gc, init)("Medium Page Size: " SIZE_FORMAT "M", ZPageSizeMedium / M);
|
||||
log_info_p(gc, init)("Medium Page Size: " SIZE_FORMAT "M", ZPageSizeMedium / M);
|
||||
} else {
|
||||
log_info(gc, init)("Medium Page Size: N/A");
|
||||
log_info_p(gc, init)("Medium Page Size: N/A");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -22,8 +22,8 @@
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "gc/shared/gcLogPrecious.hpp"
|
||||
#include "gc/z/zLargePages.hpp"
|
||||
#include "logging/log.hpp"
|
||||
#include "runtime/os.hpp"
|
||||
|
||||
ZLargePages::State ZLargePages::_state;
|
||||
@ -31,8 +31,8 @@ ZLargePages::State ZLargePages::_state;
|
||||
void ZLargePages::initialize() {
|
||||
initialize_platform();
|
||||
|
||||
log_info(gc, init)("Memory: " JULONG_FORMAT "M", os::physical_memory() / M);
|
||||
log_info(gc, init)("Large Page Support: %s", to_string());
|
||||
log_info_p(gc, init)("Memory: " JULONG_FORMAT "M", os::physical_memory() / M);
|
||||
log_info_p(gc, init)("Large Page Support: %s", to_string());
|
||||
}
|
||||
|
||||
const char* ZLargePages::to_string() {
|
||||
|
||||
@ -22,6 +22,7 @@
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "gc/shared/gcLogPrecious.hpp"
|
||||
#include "gc/z/zLock.inline.hpp"
|
||||
#include "gc/z/zMarkStack.inline.hpp"
|
||||
#include "gc/z/zMarkStackAllocator.hpp"
|
||||
@ -44,7 +45,7 @@ ZMarkStackSpace::ZMarkStackSpace() :
|
||||
const size_t alignment = (size_t)os::vm_allocation_granularity();
|
||||
const uintptr_t addr = (uintptr_t)os::reserve_memory(size, NULL, alignment, mtGC);
|
||||
if (addr == 0) {
|
||||
log_error(gc, marking)("Failed to reserve address space for mark stacks");
|
||||
log_error_p(gc, marking)("Failed to reserve address space for mark stacks");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -22,17 +22,17 @@
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "gc/shared/gcLogPrecious.hpp"
|
||||
#include "gc/z/zNUMA.hpp"
|
||||
#include "logging/log.hpp"
|
||||
|
||||
bool ZNUMA::_enabled;
|
||||
|
||||
void ZNUMA::initialize() {
|
||||
initialize_platform();
|
||||
|
||||
log_info(gc, init)("NUMA Support: %s", to_string());
|
||||
log_info_p(gc, init)("NUMA Support: %s", to_string());
|
||||
if (_enabled) {
|
||||
log_info(gc, init)("NUMA Nodes: %u", count());
|
||||
log_info_p(gc, init)("NUMA Nodes: %u", count());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -22,6 +22,7 @@
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "gc/shared/gcLogPrecious.hpp"
|
||||
#include "gc/shared/suspendibleThreadSet.hpp"
|
||||
#include "gc/z/zAddress.inline.hpp"
|
||||
#include "gc/z/zCollectedHeap.hpp"
|
||||
@ -127,11 +128,11 @@ ZPageAllocator::ZPageAllocator(ZWorkers* workers,
|
||||
return;
|
||||
}
|
||||
|
||||
log_info(gc, init)("Min Capacity: " SIZE_FORMAT "M", min_capacity / M);
|
||||
log_info(gc, init)("Initial Capacity: " SIZE_FORMAT "M", initial_capacity / M);
|
||||
log_info(gc, init)("Max Capacity: " SIZE_FORMAT "M", max_capacity / M);
|
||||
log_info(gc, init)("Max Reserve: " SIZE_FORMAT "M", max_reserve / M);
|
||||
log_info(gc, init)("Pre-touch: %s", AlwaysPreTouch ? "Enabled" : "Disabled");
|
||||
log_info_p(gc, init)("Min Capacity: " SIZE_FORMAT "M", min_capacity / M);
|
||||
log_info_p(gc, init)("Initial Capacity: " SIZE_FORMAT "M", initial_capacity / M);
|
||||
log_info_p(gc, init)("Max Capacity: " SIZE_FORMAT "M", max_capacity / M);
|
||||
log_info_p(gc, init)("Max Reserve: " SIZE_FORMAT "M", max_reserve / M);
|
||||
log_info_p(gc, init)("Pre-touch: %s", AlwaysPreTouch ? "Enabled" : "Disabled");
|
||||
|
||||
// Warn if system limits could stop us from reaching max capacity
|
||||
_physical.warn_commit_limits(max_capacity);
|
||||
@ -139,7 +140,7 @@ ZPageAllocator::ZPageAllocator(ZWorkers* workers,
|
||||
// Commit initial capacity
|
||||
_capacity = _physical.commit(initial_capacity);
|
||||
if (_capacity != initial_capacity) {
|
||||
log_error(gc)("Failed to allocate initial Java heap (" SIZE_FORMAT "M)", initial_capacity / M);
|
||||
log_error_p(gc)("Failed to allocate initial Java heap (" SIZE_FORMAT "M)", initial_capacity / M);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -380,10 +381,10 @@ bool ZPageAllocator::ensure_available(size_t size, bool no_reserve) {
|
||||
if (committed != commit) {
|
||||
// Failed, or partly failed, to increase capacity. Adjust current
|
||||
// max capacity to avoid further attempts to increase capacity.
|
||||
log_error(gc)("Forced to lower max Java heap size from "
|
||||
SIZE_FORMAT "M(%.0f%%) to " SIZE_FORMAT "M(%.0f%%)",
|
||||
_current_max_capacity / M, percent_of(_current_max_capacity, _max_capacity),
|
||||
_capacity / M, percent_of(_capacity, _max_capacity));
|
||||
log_error_p(gc)("Forced to lower max Java heap size from "
|
||||
SIZE_FORMAT "M(%.0f%%) to " SIZE_FORMAT "M(%.0f%%)",
|
||||
_current_max_capacity / M, percent_of(_current_max_capacity, _max_capacity),
|
||||
_capacity / M, percent_of(_capacity, _max_capacity));
|
||||
|
||||
_current_max_capacity = _capacity;
|
||||
}
|
||||
|
||||
@ -22,6 +22,7 @@
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "gc/shared/gcLogPrecious.hpp"
|
||||
#include "gc/shared/workgroup.hpp"
|
||||
#include "gc/z/zRuntimeWorkers.hpp"
|
||||
#include "gc/z/zThread.hpp"
|
||||
@ -66,7 +67,7 @@ ZRuntimeWorkers::ZRuntimeWorkers() :
|
||||
false /* are_GC_task_threads */,
|
||||
false /* are_ConcurrentGC_threads */) {
|
||||
|
||||
log_info(gc, init)("Runtime Workers: %u parallel", nworkers());
|
||||
log_info_p(gc, init)("Runtime Workers: %u parallel", nworkers());
|
||||
|
||||
// Initialize worker threads
|
||||
_workers.initialize_workers();
|
||||
|
||||
@ -22,10 +22,10 @@
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "gc/shared/gcLogPrecious.hpp"
|
||||
#include "gc/z/zAddressSpaceLimit.hpp"
|
||||
#include "gc/z/zGlobals.hpp"
|
||||
#include "gc/z/zVirtualMemory.inline.hpp"
|
||||
#include "logging/log.hpp"
|
||||
#include "services/memTracker.hpp"
|
||||
#include "utilities/debug.hpp"
|
||||
#include "utilities/align.hpp"
|
||||
@ -36,14 +36,14 @@ ZVirtualMemoryManager::ZVirtualMemoryManager(size_t max_capacity) :
|
||||
|
||||
// Check max supported heap size
|
||||
if (max_capacity > ZAddressOffsetMax) {
|
||||
log_error(gc)("Java heap too large (max supported heap size is " SIZE_FORMAT "G)",
|
||||
ZAddressOffsetMax / G);
|
||||
log_error_p(gc)("Java heap too large (max supported heap size is " SIZE_FORMAT "G)",
|
||||
ZAddressOffsetMax / G);
|
||||
return;
|
||||
}
|
||||
|
||||
// Reserve address space
|
||||
if (!reserve(max_capacity)) {
|
||||
log_error(gc)("Failed to reserve enough address space for Java heap");
|
||||
log_error_p(gc)("Failed to reserve enough address space for Java heap");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -132,12 +132,12 @@ bool ZVirtualMemoryManager::reserve(size_t max_capacity) {
|
||||
contiguous = false;
|
||||
}
|
||||
|
||||
log_info(gc, init)("Address Space Type: %s/%s/%s",
|
||||
(contiguous ? "Contiguous" : "Discontiguous"),
|
||||
(limit == ZAddressOffsetMax ? "Unrestricted" : "Restricted"),
|
||||
(reserved == size ? "Complete" : "Degraded"));
|
||||
log_info(gc, init)("Address Space Size: " SIZE_FORMAT "M x " SIZE_FORMAT " = " SIZE_FORMAT "M",
|
||||
reserved / M, ZHeapViews, (reserved * ZHeapViews) / M);
|
||||
log_info_p(gc, init)("Address Space Type: %s/%s/%s",
|
||||
(contiguous ? "Contiguous" : "Discontiguous"),
|
||||
(limit == ZAddressOffsetMax ? "Unrestricted" : "Restricted"),
|
||||
(reserved == size ? "Complete" : "Degraded"));
|
||||
log_info_p(gc, init)("Address Space Size: " SIZE_FORMAT "M x " SIZE_FORMAT " = " SIZE_FORMAT "M",
|
||||
reserved / M, ZHeapViews, (reserved * ZHeapViews) / M);
|
||||
|
||||
return reserved >= max_capacity;
|
||||
}
|
||||
|
||||
@ -22,6 +22,7 @@
|
||||
*/
|
||||
|
||||
#include "precompiled.hpp"
|
||||
#include "gc/shared/gcLogPrecious.hpp"
|
||||
#include "gc/z/zGlobals.hpp"
|
||||
#include "gc/z/zTask.hpp"
|
||||
#include "gc/z/zThread.hpp"
|
||||
@ -69,7 +70,7 @@ ZWorkers::ZWorkers() :
|
||||
true /* are_GC_task_threads */,
|
||||
true /* are_ConcurrentGC_threads */) {
|
||||
|
||||
log_info(gc, init)("Workers: %u parallel, %u concurrent", nparallel(), nconcurrent());
|
||||
log_info_p(gc, init)("Workers: %u parallel, %u concurrent", nparallel(), nconcurrent());
|
||||
|
||||
// Initialize worker threads
|
||||
_workers.initialize_workers();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user