JEP 364: ZGC on macOS (Experimental) (original) (raw)

Owner Erik Ă–sterlund
Type Feature
Scope Implementation
Status Closed / Delivered
Release 14
Component hotspot / gc
Discussion hotspot dash gc dash dev at openjdk dot java dot net
Effort S
Duration S
Depends JEP 333: ZGC: A Scalable Low-Latency Garbage Collector (Experimental)
Relates to JEP 377: ZGC: A Scalable Low-Latency Garbage Collector (Production)
Reviewed by Mikael Vidstedt, Per Liden
Endorsed by Mikael Vidstedt
Created 2019/08/09 13:06
Updated 2021/08/28 00:16
Issue 8229358

Summary

Port the ZGC garbage collector to macOS.

Motivation

While we expect users that require the scalability of ZGC to use Linux-based environments, it is not uncommon that developers use Macs for local development and testing, before deploying applications. There are also users who wish to run desktop applications such as IDEs with ZGC.

Description

The macOS implementation of ZGC consists of two parts:

Alternatives

We attempted an alternative prototype using POSIX shared memory objects. It used a file descriptor approach, for multi mapped memory. We abandoned this approach because, a) it did not support large pages, and b) the macOS implementation of ftruncate may only be called once to set the size of a file, which made uncommitting memory impossible.

Testing

The tests that usually run for ZGC on Linux, will be run for macOS too.

Dependencies

The work to purge the VM of the assumption that GCs have one discontiguous memory reservation is required to pave the way for the macOS port. These changes are described in preparatory enhancements, to make reviewing easier: