RFR: 8274033: Some tier-4 CDS EpsilonGC tests throw OOM [v2]

Yumin Qi minqi at openjdk.java.net
Wed Sep 22 15:50:59 UTC 2021


On Wed, 22 Sep 2021 06:42:04 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> Ioi Lam has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   @dholmes-ora comments
>
> test/hotspot/jtreg/runtime/cds/appcds/TestCommon.java line 593:
> 
>> 591: 
>> 592: 
>> 593:     public static String[] concat(ArrayList<String> prefix, String... extra) {
> 
> So you start with an `ArrayList<String>` then convert that to a `String[]` which you pass to a function that then creates a new `ArrayList<String>`, adds all the Strings to it and then converts it to a String[] again! can't help but think there has to be a simpler way to combine an ArrayList with a String[] ??

Could use the prefix, add extra to the list then prefix.toArray to avoid such conversion between ArrayList and array.

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

PR: https://git.openjdk.java.net/jdk/pull/5626


More information about the hotspot-runtime-dev mailing list