RFR: 8286066: FillerObject_klass should be loaded as early as possible [v5]
Jie Fu
jiefu at openjdk.java.net
Wed May 4 13:44:27 UTC 2022
On Wed, 4 May 2022 08:35:22 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:
> > Then part of the unused memory would be filled with `Object` and the others would be filled with `FillerObject`. I'm not sure if this kind of change is safe and if it would complicate the design/implementation/optimization of HotSpot GC algorithms. What do you think of my worries? Thanks.
>
> The gc filler objects only provide additional verification and easier debugging (i.e. any reference to such a filler object is simply an error somewhere). We don't (and can't) verify that every non-FillerObject is being referenced at all times.
>
> Also, the "wrong" filler objects would also only persist until the first garbage collection, as
>
> * all Universe initialization needs to happen before that (the VM will fail otherwise)
> * (g1 only) all objects allocated during initialization are (for g1) non-humongous
> * evacuation will reclaim these wrong fillers (and a potential evacuation failure will re-fill the holes with the correct fillers)
>
> This can certainly be combined with early as possible initialization of that global variable with the correct `j.i.v.FillerObject` to reduce the number of these objects.
>
> So I believe this is safe (and actually necessary to avoid specific TLAB sizes to fail anyway) to do.
>
> Thanks, Thomas
Sounds good!
Updated.
Thanks.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8519
More information about the hotspot-gc-dev
mailing list