[jdk16] RFR: 8257974: Regression 21% in DaCapo-lusearch-large after JDK-8236926

Stefan Johansson sjohanss at openjdk.java.net
Thu Dec 17 14:44:05 UTC 2020


Please review this fix to avoid the regression in DaCapo-lusearch-large.

**Summary** 
Doing uncommit concurrently with this benchmark was the cause of this regression. Using JFR we can see a lot of the java threads are blocking on a monitor when using the build with concurrent uncommit (but not otherwise). We know that the uncommit will affect the application threads and if a thread holding a lock gets stalled this will affect the overall performance more than expected. To avoid stalling the application threads more than necessary we can be a bit less aggressive when doing the uncommit. The initial version of concurrent uncommit tries to return the memory as quickly as possible after the GC, but there is no contract that we need to return the memory that quick and doing it a bit more lazy have more than one positive effect. 

The proposed change does three things: 
* first we delay the first uncommit after the GC shrinking the heap by 100ms, 
* after that each new invocation of the uncommit task will be delayed by 10ms (instead of run back to back)
* the size of each uncommit is changed from 256m to 128m, this will also lower the impact of each uncommit call. 

Doing these things will make the uncommit take a longer time and for applications where the uncommitted memory is needed quite quickly again, this will have the nice effect that instead of uncommitting/committing, we can just reuse the memory without involving the OS.

We have also done some experiments using `madvise` to do the uncommitting, but this doesn't fix the whole regression and needs some more investigation. A bit more information around this can be found in the bug report.

**Testing**
Tier1-3 in Mach5 and a lot of manual performance testing both locally and in our internal systems. Regression has been removed and in we instead see a small improvement, due to being able to reuse memory instead of uncommiting and then committing it again.

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

Commit messages:
 - 8257974: Regression 21% in DaCapo-lusearch-large after JDK-8236926

Changes: https://git.openjdk.java.net/jdk16/pull/42/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk16&pr=42&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8257974
  Stats: 10 lines in 2 files changed: 4 ins; 1 del; 5 mod
  Patch: https://git.openjdk.java.net/jdk16/pull/42.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk16 pull/42/head:pull/42

PR: https://git.openjdk.java.net/jdk16/pull/42



More information about the hotspot-gc-dev mailing list