On Tue, 2 Feb 2021 15:38:01 GMT, Aleksey Shipilev <[email protected]> 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 This pull request has now been integrated. Changeset: ad54d8dd Author: Aleksey Shipilev <[email protected]> URL: https://git.openjdk.java.net/jdk/commit/ad54d8dd Stats: 12 lines in 1 file changed: 7 ins; 0 del; 5 mod 8260934: java/lang/StringBuilder/HugeCapacity.java fails without Compact Strings Reviewed-by: iklam ------------- PR: https://git.openjdk.java.net/jdk/pull/2355
