RFR: 8358586: ZGC: Combine ZAllocator and ZObjectAllocator [v10]

Joel Sikström jsikstro at openjdk.org
Wed Jun 25 14:05:47 UTC 2025


> Hello,
> 
> After [JDK-8353184](https://bugs.openjdk.org/browse/JDK-8353184), ZAllocator has essentially become a mirror of ZObjectAllocator, questioning the relevance of ZAllocator. The purpose of this RFE is to combine ZAllocator and ZObjectAllocator into a single class ZObjectAllocator.
> 
> The solution I propose moves the new ZObjectAllocator as a data member in ZHeap, and is accessed solely from ZHeap. ZObjectAllocator stores a number of allocators, one for each age. Instead of storing eden and relocation allocators separately, all allocators are now in a single array, which makes it more straightforward to iterate over all allocators (when retiring pages for example). Since the underlying allocator (called PerAge) needs to be constructed with different ages, we can't use the default constructor/initialization, so I have a solution in-place for dealing with this.
> 
> Undoing an object allocation has been moved in its entirety (not calling into ZObjectAllocator) to ZHeap, where it fits much better.
> 
> Testing:
> * Oracle's tier 1-5

Joel Sikström has updated the pull request incrementally with one additional commit since the last revision:

  Add template spacing and remove extra semicolon

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/25693/files
  - new: https://git.openjdk.org/jdk/pull/25693/files/09fd3ef9..9f949d3c

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=25693&range=09
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=25693&range=08-09

  Stats: 4 lines in 2 files changed: 0 ins; 0 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/25693.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/25693/head:pull/25693

PR: https://git.openjdk.org/jdk/pull/25693


More information about the hotspot-gc-dev mailing list