Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-160

BsonBuffer pooling improvement

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 1.0
    • 1.0
    • None
    • None

    Description

      The BsonBuffer used in MongoReplyMessage<TDocument> MongoConnectionReceiveMessage<TDocument>(MongoServer) is not disposed, so its chunks aren't released back to the internal chunk pool.
      Adding "using (var buffer...)" around the try clause body fixes this.
      Also, I believe that MongoReplyMessage.ReadFrom(BsonBuffer) should include similar treatment for the BsonReader (this won't affect anything now, but future development might change this).
      I would also recommend to make chunk pool limit, which is currently 64, to be configurable and probably scale with number of processors by default. With heavy traffic

      Attachments

        Activity

          People

            robert@mongodb.com Robert Stam
            onyxmaster Aristarkh Zagorodnikov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: