If you are calling System.gc() for correctness (e.g. in a test), it is probably because some sort of finalization is being triggered. And that happens in some Java thread (e.g. Reference Handler) that System.gc() has no control over. So in practice, users need to call System.gc() and then wait for subsequent reference processing somehow.
- Re: RFR 8220238 : Enhancing j.l.Runtime/System::gc specif... David Holmes
- Re: RFR 8220238 : Enhancing j.l.Runtime/System::gc specif... Mandy Chung
- Re: RFR 8220238 : Enhancing j.l.Runtime/System::gc specif... Peter Levart
- Re: RFR 8220238 : Enhancing j.l.Runtime/System::gc specif... Roman Kennke
- Re: RFR 8220238 : Enhancing j.l.Runtime/System::gc specif... Roger Riggs
- Re: RFR 8220238 : Enhancing j.l.Runtime/System::gc specif... Peter Levart
- Re: RFR 8220238 : Enhancing j.l.Runtime/System::gc specif... Mandy Chung
- Re: RFR 8220238 : Enhancing j.l.Runtime/System::gc specif... Roger Riggs
- Re: RFR 8220238 : Enhancing j.l.Runtime/System::gc specif... Roger Riggs
- Re: RFR 8220238 : Enhancing j.l.Runtime/System::gc specif... Aleksey Shipilev
- Re: RFR 8220238 : Enhancing j.l.Runtime/System::gc specif... Martin Buchholz
- Re: RFR 8220238 : Enhancing j.l.Runtime/System::gc specif... Roger Riggs
- Re: RFR 8220238 : Enhancing j.l.Runtime/System::gc specif... Peter Levart
- Re: RFR 8220238 : Enhancing j.l.Runtime/System::gc specif... Martin Buchholz