RFR: 8299075: TestStringDeduplicationInterned.java fails because extra deduplication

Kim Barrett kbarrett at openjdk.org
Tue May 16 15:05:48 UTC 2023


On Tue, 16 May 2023 09:39:04 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:

> The tests assumes that some strings have not been deduplicated and checks for that. Unfortunately, we can have concurrently triggered GCs that invalidate those checks. I kept the call sites to show the intention of the test, but then I added a comment explaining why those checks are invalid.

Looks good.  One comment nit.

test/hotspot/jtreg/gc/stringdedup/TestStringDeduplicationTools.java line 409:

> 407: 
> 408:         private static void checkNotDeduplicated(Object value1, Object value2) {
> 409:             // Note that the following check is invalid since a concurrent GC

I think the word "concurrent" can be dropped - it seems like any GC could trip over the problem.
It's just that the STW GCs are unlikely to occur and trip this because the various forceDeduplication
calls force GCs at those points, making automatically triggered GCs elsewhere unlikely.

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

Marked as reviewed by kbarrett (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/14005#pullrequestreview-1428805632
PR Review Comment: https://git.openjdk.org/jdk/pull/14005#discussion_r1195308564


More information about the hotspot-gc-dev mailing list