RFR: 8229517: Support for optional asynchronous/buffered logging [v14]

Xin Liu xliu at openjdk.java.net
Thu May 13 07:24:57 UTC 2021


On Thu, 13 May 2021 07:07:37 GMT, Xin Liu <xliu at openjdk.org> wrote:

>> src/hotspot/share/logging/logAsyncFlusher.cpp line 42:
>> 
>>> 40:   assert_lock_strong(&_lock);
>>> 41: 
>>> 42:   if (_buffer.size() >= _buffer_max_size)  {
>> 
>> As mentioned in the CSR, I prefer dropping the newest message, not the oldest one. So there would be no reason to pop anything from the buffer.
>
> copy that.  I will update it.

> One thing occurring to me was that a global buffer for all outputs is maybe not the best choice. One buffer per LogFileOutput seems like a cleaner, more natural fit:

That's another reason I introduce a hashmap for dropped counters.

I read you in the RFC thread about the "Global Big Lock" for all filed-based log outputs.  I know it's not scalable.I proposed to Volker splitting buffers for different outputs. Then the cost of synchronization would be effectively same as current UL. Volker countered that it wasn't an issue until users deploys many log files. it seems rare. We can leave it for future improvement.

-------------

PR: https://git.openjdk.java.net/jdk/pull/3135


More information about the hotspot-dev mailing list