RFR: 8260267: ZGC: Reduce mark stack usage [v6]
Per Liden
pliden at openjdk.java.net
Thu May 20 10:10:08 UTC 2021
> Under some conditions, striped marking can cause excessive mark stack memory usage. For example, when the object graph has one or more N:1 relations ships, where N is a large number.
>
> To avoid pushing mark stack entries to already marked objects, and thus reduce mark stack memory usage, this patch adds does two things:
> * GC threads will under some conditions mark the object before pushing, else (if the condition to mark failed)
> * GC threads will check if the object is already marked before pushing.
>
> The conditions for marking before pushing is:
> * We are using a single stripe, in which cases striped marking is essentially disabled anyway.
> * We see excessive mark stack usage. In other words, the mark stack allocator indicates "high usage".
>
> To make this easier to review, this PR contains two commits:
> * `ZGC: Reduce mark stack usage` - This patch adds the infrastructure needed to mark before push, but only does so if we are using a single stripe.
> * `ZGC: Mark before push if mark stack usage is high` - This patch adds the condition to mark before push if the mark stack allocator indicates "high usage". As a bonus, this patch will also uncommit memory used for mark stacks after the marking has completed.
>
> Testing:
> * Tier1-7
> * SPECjbb2015, score and marking times unaffected
> * casparcwang at tencent.com reports that this patch, in combination with PR #3455, solves the problem for Apache Zookeeper.
Per Liden has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains ten commits:
- Merge master
- Print mark stack memory usage
- Shrink to currently used
- Always mark before push
- Review comments from StefanJ
- Review comments from StefanJ and Albert
- Merge master
- ZGC: Mark before push if mark stack usage is high
- ZGC: Reduce mark stack usage
-------------
Changes: https://git.openjdk.java.net/jdk/pull/3460/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=3460&range=05
Stats: 308 lines in 20 files changed: 204 ins; 53 del; 51 mod
Patch: https://git.openjdk.java.net/jdk/pull/3460.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/3460/head:pull/3460
PR: https://git.openjdk.java.net/jdk/pull/3460
More information about the hotspot-gc-dev
mailing list