RFR: 8340728: Test vmTestbase/gc/memory/Nio/Nio.java is failing to allocate all direct buffer memory [v2]

Brian Burkhalter bpb at openjdk.org
Wed Oct 23 14:40:11 UTC 2024


On Tue, 22 Oct 2024 19:15:51 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

>> First attempt to allocate `VM.maxDirectMemory()` bytes of direct buffer memory, decreasing by 1024 bytes for each `OutOfMemoryError` until allocation succeeds.
>
> Brian Burkhalter 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 two additional commits since the last revision:
> 
>  - Merge
>  - 8340728: Test vmTestbase/gc/memory/Nio/Nio.java is failing to allocate all direct buffer memory

test/hotspot/jtreg/vmTestbase/gc/memory/Nio/Nio.java line 85:

> 83:                 System.out.println("... success");
> 84:             } catch (OutOfMemoryError oom) {
> 85:                 max_size -= 1024;

I wonder whether a test of `max_size` should be performed here to signal an error should it fall below some threshold, e.g., `MAX_VM_SIZE - 8*1024` or MAX_VM_SIZE - 16*1024`?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21623#discussion_r1812928010


More information about the hotspot-gc-dev mailing list