JDK-8258553 : Limit number of fields in instance to be considered for scalar replacement
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 8,11,17
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-12-17
  • Updated: 2024-01-19
  • Resolved: 2020-12-18
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 17
17 b03Fixed
Related Reports
Duplicate :  
Relates :  
Description
I stumbled upon a test that we have (gc/TestBigObj.java) that has an object with 64k fields and that is scalar replaceable. Doing so puts a lot of strain on the compiler. I ran a few test and benchmarks and the maximum number of fields in scalar-replaced object that I've seen was 59. I think it should be reasonable to set a limit on the number of fields to 512.  
Comments
Changeset: 7f92d187 Author: Igor Veresov <iveresov@openjdk.org> Date: 2020-12-18 21:08:04 +0000 URL: https://git.openjdk.java.net/jdk/commit/7f92d187
18-12-2020