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

BsonBuffer pooling improvement

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.0
    • Affects Version/s: 1.0
    • Component/s: None
    • None

      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

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

              Created:
              Updated:
              Resolved: