daniel.daugherty@Eng 2000-02-04
From hs-chat e-mails by David Detlefs and Steffen Grarup:
> > Not quite. In MarkSweep, all objects are marked and everything is
> > compacted. The mark-compact supports compaction through a series of
> > spaces, see Space::next_compaction_space().
>
> Aha. I see that now, and realize that I was misled by the following
> code in MarkSweep::invoke_at_safepoint:
>
> mark_sweep_phase1(marked_for_deopt);
>
> if (jvmpi::is_event_enabled(JVMPI_EVENT_OBJECT_FREE)) {
> JVMPI_Object_Free clo;
> Universe::old_gen()->object_iterate(&clo);
> Universe::perm_gen()->object_iterate(&clo);
> }
>
> I saw that this did not seem to be posting the JVMPI Object_free
> events for new generation objects that might be unmarked, and assumed
> that meant that they wouldn't be collected. Is this just a bug?
That is certainly a bug!! Thanks for catching this. The code should do
if (jvmpi::is_event_enabled(JVMPI_EVENT_OBJECT_FREE)) {
JVMPI_Object_Free clo;
Universe::object_iterate(&clo);
}
rather than iterating over the individual generations.
From hs-chat e-mails by David Detlefs and Steffen Grarup:
> > Not quite. In MarkSweep, all objects are marked and everything is
> > compacted. The mark-compact supports compaction through a series of
> > spaces, see Space::next_compaction_space().
>
> Aha. I see that now, and realize that I was misled by the following
> code in MarkSweep::invoke_at_safepoint:
>
> mark_sweep_phase1(marked_for_deopt);
>
> if (jvmpi::is_event_enabled(JVMPI_EVENT_OBJECT_FREE)) {
> JVMPI_Object_Free clo;
> Universe::old_gen()->object_iterate(&clo);
> Universe::perm_gen()->object_iterate(&clo);
> }
>
> I saw that this did not seem to be posting the JVMPI Object_free
> events for new generation objects that might be unmarked, and assumed
> that meant that they wouldn't be collected. Is this just a bug?
That is certainly a bug!! Thanks for catching this. The code should do
if (jvmpi::is_event_enabled(JVMPI_EVENT_OBJECT_FREE)) {
JVMPI_Object_Free clo;
Universe::object_iterate(&clo);
}
rather than iterating over the individual generations.