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

Memory Leak 2.0 driver

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • 2.0
    • API, Performance
    • Windows
    • Minor Change

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: