Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-1519

DBCursor finalizer should not hold on to the query results

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 2.13.0, 3.0.0
    • None
    • Query Operations
    • None

    Description

      DBCursor has a field that is populated with an instance of a class with a finalize() method, which is used to close a dangling cursor. But the class is an inner class, and therefore references the DBCursor instance, which in turn references the last query batch. This stresses out the garbage collector, which now has to keep all those objects alive until finalize() is called.

      A better design would be to make the class with the finalizer a static inner class that only references the cursor id and server address.

      Attachments

        Activity

          People

            jeff.yemin@mongodb.com Jeffrey Yemin
            jeff.yemin@mongodb.com Jeffrey Yemin
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: