JDK-8311604 : Simplify NOCOOPS requested addresses for archived heap objects
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-07-06
  • Updated: 2023-07-12
  • Resolved: 2023-07-09
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 22
22 b06Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
If CDS archived heap objects can be loaded at their "requested addresses", we can avoid relocation of their oop fields.

The calculation of the requested addresses is too complicated with -XX:-UseCompressedOops. We first pick a point close to the top of the *dumptime* heap:

https://github.com/openjdk/jdk/blob/0c86c31bccd676e1cfbd35898ee16e89d5752688/src/hotspot/share/cds/archiveHeapWriter.cpp#L342

Then, we find out where this point would be if the *runtime* heap starts at 0x10000000:

https://github.com/openjdk/jdk/blob/0c86c31bccd676e1cfbd35898ee16e89d5752688/src/hotspot/share/cds/heapShared.cpp#L1695-L1720

The problem is for -XX:-UseCompressedOops, the word "requested address" has two different meaning (between the two blocks of code referenced above). This difference is not explained in the comments here:

https://github.com/openjdk/jdk/blob/0c86c31bccd676e1cfbd35898ee16e89d5752688/src/hotspot/share/cds/archiveHeapWriter.hpp#L73

==============================
With -XX:-UseCompressedOops, the OS will randomly pick a range for the runtime heap, so we will always need to relocate anyway. We can greatly simplify the dumping code by writing the first archived heap object at 0x10000000.

Comments
Changeset: 581f90e2 Author: Ioi Lam <iklam@openjdk.org> Date: 2023-07-09 15:18:46 +0000 URL: https://git.openjdk.org/jdk/commit/581f90e242b8a943215a223189d171b7ede37785
09-07-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/14792 Date: 2023-07-06 23:39:34 +0000
06-07-2023