Skip to content

Initialize at build-time a subset of the JDK #2650

@vjovanov

Description

@vjovanov

Currently, the whole JDK is initialized at build time. This causes many issues with packages like java.awt where threads get stored into the image heap.

We plan to minimize the list of packages that are initialized at build time by default. The list should be designed with the following concerns:

  1. It should contain packages that are critical for performance of every-day user programs. All primitives, collections, strings, and similar must be initialized at build time.
  2. It should contain packages that are not hard to maintain (when build-time initialized) and hence cause trouble down the road.
  3. It should not bloat the "Hello, World!" image with many class initializers that will never be executed.

This will unfortunately be a breaking change for many projects. However, this change should bring fewer failures in native images and significantly ease the maintenance of the JDK.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions