While working on the JDK-8240709 I have found that the test created for JDK-8134947 (currently executed on macOS only) can fail due to memory leaks(more often if change it to be stricter). See my comments inline.
------------- Commit messages: - Initial fix Changes: https://git.openjdk.java.net/jdk/pull/514/files Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=514&range=00 Issue: https://bugs.openjdk.java.net/browse/JDK-8253977 Stats: 183 lines in 5 files changed: 134 ins; 11 del; 38 mod Patch: https://git.openjdk.java.net/jdk/pull/514.diff Fetch: git fetch https://git.openjdk.java.net/jdk pull/514/head:pull/514 PR: https://git.openjdk.java.net/jdk/pull/514