JDK-8319115 : GrowableArray: Do not initialize up to capacity
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2023-10-30
  • Updated: 2025-08-11
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.
Other
tbdUnresolved
Related Reports
Relates :  
Relates :  
Relates :  
Description
There's no need to instantiate the data between _len and _capacity on resize, as these elements do not yet exist.
Comments
A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/16918 Date: 2023-12-01 07:56:04 +0000
18-12-2023

Another concern: GrowableArray should never call the deconstructor on its elements, and should ensure that all objects are trivially deconstructable (statically). See std::is_trivially_destructible. That way we now should never call the deconstructors on it. But for GrowableArrayCHeap, we must make sure that the deconstructors get called.
28-11-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/16418 Date: 2023-10-30 14:49:25 +0000
30-10-2023