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

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.9.0
    • Affects Version/s: 2.6.5, 2.7.3, 2.8.0
    • Component/s: Performance
    • Labels:
      None
    • Fully Compatible

      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)

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

              Created:
              Updated:
              Resolved: