RFR: 8259231: Fix the chance to allocate failure and improve the speed and quality of EpsilonHeap::allocate_work

Lehua Ding github.com+13173904+lhtin at openjdk.java.net
Tue Jan 5 12:12:02 UTC 2021


Hi all,

The `EpsilonHeap::allocate_work` method maybe can be fixed and improved by this:
1. it can prevent allocate failure by retry `_space->par_allocate` before expanding virtual space,  when there not enough virtual space but another thread expanding succeeded just and has enough space.
2. it can reduce the lock time by move `res = _space->par_allocate(size);` out of lock scope.

Test on macosx-x86_64-server-{release, fastdebug, slowdebug} with current test case.

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

Commit messages:
 - add a comment
 - Epsilon: improve speed and quality of EpsilonHeap::allocate_work

Changes: https://git.openjdk.java.net/jdk/pull/1794/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=1794&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8259231
  Stats: 32 lines in 2 files changed: 12 ins; 2 del; 18 mod
  Patch: https://git.openjdk.java.net/jdk/pull/1794.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/1794/head:pull/1794

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



More information about the hotspot-gc-dev mailing list