JFR: Remove finalize() methods

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P3
    • 19
    • Affects Version/s: None
    • Component/s: hotspot
    • None
    • jfr
    • b22

      The RepositoryChunk::finalize() method has been kept since the inception of JFR, before try-with-resources (JDK 7) and Cleaner (JDK 9) existed. The method should be removed now that finalization is deprecated for removal.

      RepositoryChunks are reference counted and when a recording is closed, chunks that are not referenced by a recording are removed from the disk repository. Users can get a listing of not closed recordings by invoking FlightRecorder::getRecordings() so they own the lifecycle already. If a user forget to close a recording, the data will be kept in the repository.

      ChunkInputStream och ChunkChannel have finalize() methods and increases the reference counter when copying data out from the disk repository. If an IOException happens during file reading, they are closed and the reference counter decreased for the remaining chunks. Finalizers are not needed.

            Assignee:
            Erik Gahlin
            Reporter:
            Erik Gahlin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: