RFR: 8267311: vmTestbase/gc/gctests/StringInternGC/StringInternGC.java eventually OOMEs [v2]
Thomas Schatzl
tschatzl at openjdk.java.net
Fri May 21 09:39:32 UTC 2021
On Fri, 21 May 2021 09:22:09 GMT, Jie Fu <jiefu at openjdk.org> wrote:
>> Hi all,
>>
>> vmTestbase/gc/gctests/StringInternGC/StringInternGC.java fails with release VM on our many-core machines due to `-XX:MaxRAMPercentage=0`.
>> This is because `-XX:MaxRAMPercentage=0` will be 0 if JTREG_JOBS > 25 [1].
>>
>> Reproduce:
>> - make test TEST="vmTestbase/gc/gctests/StringInternGC/StringInternGC.java" JTREG="JOBS=26" CONF=server-release
>>
>> `-Xmx1g` is added to make it more robust.
>> Note: we still see failure with `-Xmx512m`.
>>
>> Thanks.
>> Best regards,
>> Jie
>>
>> [1] https://github.com/openjdk/jdk/blob/master/make/RunTests.gmk#L741
>
> Jie Fu has updated the pull request incrementally with one additional commit since the last revision:
>
> vmTestbase/gc/gctests/StringInternGC/StringInternGC.java eventually OOMEs
Changes requested by tschatzl (Reviewer).
test/hotspot/jtreg/vmTestbase/gc/gctests/StringInternGC/StringInternGC.java line 49:
> 47: */
> 48: public class StringInternGC extends ThreadedGCTest {
> 49: private int maxLength = 1000; // Maximum length to add per operation.
Suggestion:
private int maxLength = 1000; // Maximum number of characters to add per operation.
test/hotspot/jtreg/vmTestbase/gc/gctests/StringInternGC/StringInternGC.java line 50:
> 48: public class StringInternGC extends ThreadedGCTest {
> 49: private int maxLength = 1000; // Maximum length to add per operation.
> 50: private int maxTotalLength = 128 * 1024; // Random total maximum length of the string.
Suggestion:
private int maxTotalLength = 128 * 1024; // Total maximum length of the string until a new StringBuffer will be allocated.
test/hotspot/jtreg/vmTestbase/gc/gctests/StringInternGC/StringInternGC.java line 62:
> 60: for (int i = 0; i < length; ++i)
> 61: sb.append((char) LocalRandom.nextInt(Integer.MAX_VALUE));
> 62: return sb.toString();
I was expecting that the code would regularly (every few seconds) cause a full gc to clean up strings from the string table (afaik all these tests run for a fixed length, do not know how long; please look yourselves and determine a "good" interval, like 5 seconds or so). Either via `System.gc()` or whitebox methods.
Particularly `System.gc()` in conjunction with `-XX:+ExplicitGCInvokesConcurrent` causes concurrent gc's if needed, at least on the default collector (G1) so that *some* string table unloading activity also occurs.
-------------
PR: https://git.openjdk.java.net/jdk/pull/4086
More information about the hotspot-gc-dev
mailing list