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

Make DBCursor finalizer optional and disable it in all cases where there is no cursor maintained on the server

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.6.5, 2.7.3, 2.8.0
    • Fix Version/s: 2.9.0
    • Component/s: Performance
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • # Replies:
      3
    • Last comment by Customer:
      false

      Description

      Finalizers can have a negative affect on overall GC throughput. DBApiLayer.Result has a finalize method which pushes the cursor onto a queue of dead cursors for later cleanup. The problem is that driver users still pay the cost of of the finalizer in these cases:

      1. they are diligent about closing cursors
      2. findOne, or any query with a negative batch size or other situation where there is no cursor maintained on the server to clean up.

      We can address this in two ways

      1. Add option to MongoOptions to allow driver users to disable the finalizer
      2. Always disable the finalizer when there is no cursor maintained on the server (cursor == 0 in query response)

        Issue Links

          Activity

          Hide
          auto auto (Inactive) added a comment -

          Author:

          {u'date': u'2012-07-27T08:41:52-07:00', u'email': u'jeff.yemin@10gen.com', u'name': u'Jeff Yemin'}

          Message: JAVA-610: Make DBCursor finalizer optional and disable it in all cases where there is no cursor maintained on the server
          Branch: master
          https://github.com/mongodb/mongo-java-driver/commit/72ad520cdb238b276ad8162bac477b8ee9a41347

          Show
          auto auto (Inactive) added a comment - Author: {u'date': u'2012-07-27T08:41:52-07:00', u'email': u'jeff.yemin@10gen.com', u'name': u'Jeff Yemin'} Message: JAVA-610 : Make DBCursor finalizer optional and disable it in all cases where there is no cursor maintained on the server Branch: master https://github.com/mongodb/mongo-java-driver/commit/72ad520cdb238b276ad8162bac477b8ee9a41347
          Hide
          auto auto (Inactive) added a comment -

          Author:

          {u'date': u'2012-08-01T11:52:58-07:00', u'email': u'jeff.yemin@10gen.com', u'name': u'Jeff Yemin'}

          Message: JAVA-610: only start cursor clean thread if cursor finalizer is enabled
          Branch: master
          https://github.com/mongodb/mongo-java-driver/commit/d41c197e1fe709ee98f8cbedd9d5991b22461f88

          Show
          auto auto (Inactive) added a comment - Author: {u'date': u'2012-08-01T11:52:58-07:00', u'email': u'jeff.yemin@10gen.com', u'name': u'Jeff Yemin'} Message: JAVA-610 : only start cursor clean thread if cursor finalizer is enabled Branch: master https://github.com/mongodb/mongo-java-driver/commit/d41c197e1fe709ee98f8cbedd9d5991b22461f88
          Hide
          jeff.yemin Jeff Yemin added a comment -

          Closing as part of 2.9.0 release process.

          Show
          jeff.yemin Jeff Yemin added a comment - Closing as part of 2.9.0 release process.

            People

            • Assignee:
              jeff.yemin Jeff Yemin
              Reporter:
              jeff.yemin Jeff Yemin
              Participants:
              Last commenter:
              Barrie Segal
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Days since reply:
                2 years, 44 weeks, 5 days ago
                Date of 1st Reply: