RFR: 8253763: ParallelObjectIterator should have virtual destructor

Stefan Karlsson stefank at openjdk.java.net
Tue Sep 29 07:23:10 UTC 2020


On Tue, 29 Sep 2020 07:20:25 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> The ParallelObjectIterator should have virtual destructor, since implementations of
>> CollectedHeap::parallel_object_iterator() returns the base type, which is later passed to the delete operator.
>> Today both G1 and Shenandoah leaks memory here. I noticed this bug when when implementing
>> ZCollectedHeap::parallel_object_iterator(). Bug was introduced in JDK-8215624.
>
> Good catch.

Nice catch!

-------------

PR: https://git.openjdk.java.net/jdk/pull/395



More information about the hotspot-gc-dev mailing list