JEP 132: More-prompt finalizationJEP 132: More-prompt finalizationOwnerJon MasamitsuTypeFeatureScopeJDKStatusClosed / WithdrawnDiscussionhostspot dash dev at openjdk dot java dot netEffortSDurationSReviewed byPaul HohenseeEndorsed byBrian Goetz, Paul HohenseeCreated2011/08/09 20:00Updated2019/10/09 19:05Issue8046122Summary
Improve the promptness of finalization by use of multiple finalizer threads
and/or aggressive management of the finalizer queue, and define a Java API for
an application to request that reference processing be done.
Non-Goals
Better management of native resources is not a goal of this project. Users may
find more-prompt finalization aids native resource management but that will
depend on the individual application.
Success Metrics
Details are TBD but generally a stress test for finalization should result in
more-prompt finalization than without this project.  There are JRockit
finalization stress tests that Hotspot generally does not pass which it should
pass when this project is integrated.
Motivation
Customers have asked for more-prompt finalization. This work will not satisfy
all customers but should satisfy more.
Description
More intense management of the finalization may be needed (objects moved from
the finalization queue in larger numbers).  Investigate the JRockit processing
for finalization. This includes possible modification of the JDK library
implementation of ReferenceHandleThread, FinalizerThread and
java.lang.ref.Reference.
Additional finalization threads may be added when finalization is requested.
Define a new Java API that will advise the garbage collector and runtime that
finalization should be done. Implement actions on the part of the garbage
collector and runtime to hasten finalization. For example, finalizable objects
are discovered during a garbage collection so a garbage collection may be
needed.
Alternatives
Educate users on alternatives to finalization.
Testing
Tests which create many finalizable objects and which print the number of
objects finalized will be needed. Such tests exist in Hotspot nightly testing
and similar tests for JRockit exist. Some modifications may be needed to stress
test this feature. Even with this feature, finalization will be
non-deterministic, so that should be taken into account when judging the
pass/fail of a test.
Risks and Assumptions
If finalization is removed from the Java language then this project will not be
necessary.
Impact

Performance/scalability: Should be no change or improved
Documentation: Some documentation for licensees may be needed

InstallingContributingSponsoringDevelopers' GuideVulnerabilitiesJDK GA/EA BuildsMailing listsWiki
                      · IRCBylaws · CensusLegalWorkshopJEP ProcessSource codeMercurialGitHubToolsGitjtreg harnessGroups(overview)AdoptionBuildClient LibrariesCompatibility & Specification ReviewCompilerConformanceCore LibrariesGoverning BoardHotSpotIDE Tooling & SupportInternationalizationJMXMembersNetworkingPortersQualitySecurityServiceabilityVulnerabilityWebProjects(overview,
      archive)AmberBabylonCRaCCaciocavalloClosuresCode ToolsCoinCommon VM InterfaceCompiler GrammarDetroitDevelopers' GuideDevice I/ODukeGalahadGraalIcedTeaJDK 7JDK 8JDK 8 UpdatesJDK 9JDK
      (…,
       21,
       22,
       23)JDK UpdatesJavaDoc.NextJigsawKonaKullaLambdaLanaiLeydenLilliputLocale EnhancementLoomMemory Model UpdateMetropolisMission ControlMulti-Language VMNashornNew I/OOpenJFXPanamaPenrosePort: AArch32Port: AArch64Port: BSDPort: HaikuPort: Mac OS XPort: MIPSPort: MobilePort: PowerPC/AIXPort: RISC-VPort: s390xPortolaSCTPShenandoahSkaraSumatraTiered AttributionTsanType AnnotationsValhallaVeronaVisualVMWakefieldZeroZGC

        © 2024 Oracle Corporation and/or its affiliates
        Terms of Use
        ·
        
            License: GPLv2
        · Privacy
        · Trademarks
