Integrated: 8342102: ZGC: Optimize copy constructors in ZPhysicalMemory
Joel Sikström
jsikstro at openjdk.org
Mon Oct 21 13:19:41 UTC 2024
On Tue, 15 Oct 2024 11:50:13 GMT, Joel Sikström <jsikstro at openjdk.org> wrote:
> ZPhysicalMemory stores a sorted array of physical memory segments. Segments are added using either add_segments or add_segment, where the former calls add_segment on each individual segment. add_segment inserts segments in address order and also merges segments when possible.
>
> When copying an instance of ZPhysicalMemory, segments are currently copied using either add_segments or add_segment, which works as described above. This requires more work than necessary and should be simplified to account for the fact that the array of segments is always sorted.
>
> When copying, the copy constructors should instead use append or appendAll from the underlying GrowableArrayCHeap and also reserve enough memory so that the array's capacity is not increased more times than necessary during copying.
>
> Tested with tiers 1-3.
This pull request has now been integrated.
Changeset: 1f357485
Author: Joel Sikström <jsikstro at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/1f3574855e79221739d8800235583b7c47ebae97
Stats: 12 lines in 1 file changed: 4 ins; 0 del; 8 mod
8342102: ZGC: Optimize copy constructors in ZPhysicalMemory
Reviewed-by: stefank, kbarrett, aboldtch
-------------
PR: https://git.openjdk.org/jdk/pull/21523
More information about the hotspot-gc-dev
mailing list