RFR: 8260934: java/lang/StringBuilder/HugeCapacity.java fails without Compact Strings [v2]
Ioi Lam
iklam at openjdk.java.net
Tue Feb 9 20:00:42 UTC 2021
On Tue, 9 Feb 2021 19:48:07 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
>> $ CONF=linux-x86_64-server-fastdebug make run-test TEST=java/lang/StringBuilder/HugeCapacity.java TEST_VM_OPTS=-XX:-CompactStrings
>>
>> STDERR:
>> java.lang.OutOfMemoryError: Required length exceeds implementation limit
>> at java.base/java.lang.AbstractStringBuilder.newCapacity(AbstractStringBuilder.java:259)
>> at java.base/java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:229)
>> at java.base/java.lang.AbstractStringBuilder.ensureCapacity(AbstractStringBuilder.java:213)
>> at java.base/java.lang.StringBuilder.ensureCapacity(StringBuilder.java:87)
>> at HugeCapacity.testLatin1(HugeCapacity.java:49)
>> at HugeCapacity.main(HugeCapacity.java:37)
>>
>> I went back and forth in fixing this test, and I think the best we can do is sense the current setting on `CompactStrings` and choose the test configuration based on that. The alternative is to use `WhiteBox` within the test (tried, it is quite a bit ugly). Note that this test deliberately does not run `-XX:-CompactStrings` even when `vm.opt.final.CompactStrings` returns true (= "available"), because that might mean `TEST_VM_OPTS=-XX:+CompactStrings` is in effect, and we have the VM option conflict.
>>
>> Additional testing:
>> - [x] Linux x86_64, affected test (default), passes
>> - [x] Linux x86_64, affected test (`-XX:-CompactStrings`), passes
>> - [x] Linux x86_64, affected test (`-XX:+CompactStrings`), passes
>
> Aleksey Shipilev has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision:
>
> - Remove non-essentials
> - Simplify
> - Merge branch 'master' into JDK-8260934-hugecapacity-cs
> - 8260934: java/lang/StringBuilder/HugeCapacity.java fails without Compact Strings
Marked as reviewed by iklam (Reviewer).
-------------
PR: https://git.openjdk.java.net/jdk/pull/2355
More information about the core-libs-dev
mailing list