Skip to content

System.runFinalization marked as deprecated for removal #605

@lampajr

Description

@lampajr

Currently we are using System.runFinalization as part of the initial, enforced, garbage collection execution. See

private void runSystemGC() {
long actualGCRun = System.currentTimeMillis();
// Run the GC twice and force finalization before every GC run
System.runFinalization();
System.gc();
System.runFinalization();
System.gc();
log.info("GC execution took {} ms", (System.currentTimeMillis() - actualGCRun));
}

Since version 18 the method was marked as deprecate for removal with:

Finalization has been deprecated for removal. See Object.finalize for background information and details about migration options.
When running in a JVM in which finalization has been disabled or removed, no objects will be pending finalization, so this method does nothing

We should probably start thinking if that is really needed and if so, how to migrate that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions