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

Memory Leak 2.0 driver

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.0
    • Component/s: API, Performance
    • Environment:
      Windows
    • Minor Change

      I have a client application that inserts documents into Mongo at a very high speed, using the InsertAsync method. However, the connection pins the objects for too long with AsyncPinned handles, thus increasing my memory usage by a lot until it throws an OutOfMemory exception.

      I solved this partly by implementing object pooling and using BulkWriteAsync, uploading about 5K documents at the same time. This allows the connection to unpin the documents before uploading the next bulk. This works fine for small documents but not for bigger ones. Mongo seems to perform slower with every BulkWrite, steadily increasing my memory again as my pools fill, and eventually throws a Timeout Exception.

      Can this be fixed or is there any other way around it? The performance of this application is very important so I dont want to use the .Wait() option.

            Assignee:
            Unassigned Unassigned
            Reporter:
            shadowsalyer Fedor Finkenflugel
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: