diff --git a/src/hotspot/share/logging/logAsyncWriter.cpp b/src/hotspot/share/logging/logAsyncWriter.cpp index c9ce7fbdbf2..3c56c506528 100644 --- a/src/hotspot/share/logging/logAsyncWriter.cpp +++ b/src/hotspot/share/logging/logAsyncWriter.cpp @@ -116,10 +116,7 @@ AsyncLogWriter::AsyncLogWriter() void AsyncLogWriter::write() { ResourceMark rm; - // Similar to AsyncLogMap but on resource_area - ResourceHashtable snapshot; + AsyncLogMap snapshot; // lock protection. This guarantees I/O jobs don't block logsites. { diff --git a/src/hotspot/share/logging/logAsyncWriter.hpp b/src/hotspot/share/logging/logAsyncWriter.hpp index 549c5d9f3a5..b81015cd2de 100644 --- a/src/hotspot/share/logging/logAsyncWriter.hpp +++ b/src/hotspot/share/logging/logAsyncWriter.hpp @@ -58,11 +58,12 @@ class AsyncLogWriter : public NonJavaThread { friend class AsyncLogTest; friend class AsyncLogTest_logBuffer_vm_Test; class AsyncLogLocker; + + // account for dropped messages + template using AsyncLogMap = ResourceHashtable; + uint32_t, 17, /*table_size*/ + ALLOC_TYPE, mtLogging>; // Messsage is the envelop of a log line and its associative data. // Its length is variable because of the zero-terminated c-str. It is only valid when we create it using placement new @@ -154,7 +155,7 @@ class AsyncLogWriter : public NonJavaThread { PlatformMonitor _lock; bool _data_available; volatile bool _initialized; - AsyncLogMap _stats; // statistics for dropped messages + AsyncLogMap _stats; // ping-pong buffers Buffer* _buffer;