RFR: Restore event descriptions immortality
Kelvin Nilsen
kdnilsen at openjdk.org
Wed Apr 12 13:21:24 UTC 2023
On Wed, 12 Apr 2023 10:27:56 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
> Upstream code has event descriptions as immortal strings for a reason: they are passed inside the logging classes, and so the references to them may outlive the scope of the current method. We have seen logs corruption because of that before, e.g. in hs_err-s `Events` section. This PR restores the immortality of event descriptions, producing const strings with macros.
>
> This also stops emitting "(GLOBAL)" for global collections, which I think is what non-generational Shenandoah mode prints. Please tell me if we still need to print "(GLOBAL)" in generational mode.
>
> Tangentially, this also improves performance for compilers that choose to initialize the automatic storage for `char msg[1024]`, see https://isocpp.org/files/papers/P2723R0.html.
>
> Additional testing:
> - [x] Eyeballing the GC logs
Marked as reviewed by kdnilsen (Committer).
We do distinguish GLOBAL from YOUNG and OLD in generational mode. A GLOBAL collection is when we collect both OLD and YOUNG at the same time. These are generally rare. They show up, for example, if someone explicitly invokes System.gc().
src/hotspot/share/gc/shenandoah/shenandoahUtils.hpp line 50:
> 48: switch (generation_type) { \
> 49: case GLOBAL: \
> 50: return prefix "" postfix; \
Suggest reporting GLOBAL here.
-------------
PR Review: https://git.openjdk.org/shenandoah/pull/253#pullrequestreview-1381302765
PR Comment: https://git.openjdk.org/shenandoah/pull/253#issuecomment-1505261924
PR Review Comment: https://git.openjdk.org/shenandoah/pull/253#discussion_r1164124138
More information about the shenandoah-dev
mailing list