[jdk17u-dev] RFR: 8292989: Avoid dynamic memory in AsyncLogWriter [v2]

Aleksey Shipilev shade at openjdk.org
Thu Aug 10 11:39:28 UTC 2023


On Fri, 4 Aug 2023 19:40:10 GMT, Xin Liu <xliu at openjdk.org> wrote:

>> This patch is *NOT* a clean backport.  The logic part is exactly the same, but I have to adjust code in the following parts:
>> 1. change from KVHashtable to ResourceHashtable because we want to use resourceArea instead of C_HEAP. 
>> 2. rewrite lambda expression using Functor. 
>> 
>> Testing: 
>> jdk-test1 tests including gtest. 
>> Manually check there's no malloc/free in runtime.
>
> Xin Liu has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Revert resourceHash.hpp and use functor instead of C++ lambda.

OK, this looks good, but I think we should fix/backport these two before backporting this one to 17u:
  https://bugs.openjdk.org/browse/JDK-8297302 (fixed, should be backported)
  https://bugs.openjdk.org/browse/JDK-8309067 (not fixed, should be dealt with first)

src/hotspot/share/logging/logAsyncWriter.cpp line 77:

> 75:   if (!_buffer->push_back(output, decorations, msg)) {
> 76:     bool p_created;
> 77:     uint32_t* counter = _stats.put_if_absent(output, 0, &p_created);

Just checking: the rewrite `add_if_absent` -> `put_if_absent` is needed, because the underlying type changed, right?

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

PR Review: https://git.openjdk.org/jdk17u-dev/pull/1630#pullrequestreview-1571651821
PR Review Comment: https://git.openjdk.org/jdk17u-dev/pull/1630#discussion_r1289970916


More information about the jdk-updates-dev mailing list