Uploaded image for project: 'Couchbase .NET client library'
  1. Couchbase .NET client library
  2. NCBC-2995

Slow memory leak in OrphanReporter

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 3.2.5
    • 3.2.3
    • library
    • None
    • 1

    Description

      The recent rework of OrphanReporter to prevent blocking of threads in the thread pool has created a slow memory leak. This is due to this corner-case bug in System.Threading.Channels: https://github.com/dotnet/runtime/issues/761

      The queue within OrphanReporter is a very low volume queue, in ideal scenarios never receiving any items at all. In this case, using ChannelReader.WaitForReadyAsync with a timeout via CancellationToken will leak the memory associated with the CancellationTokenSource/callbacks/etc on each loop. This memory will be cleaned up whenever the next item arrives in the queue, but this may never happen and it will usually grow indefinitely.

      https://forums.couchbase.com/t/memory-leak-in-couchbase-net-sdk/32084

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            btburnett3 Brant Burnett
            btburnett3 Brant Burnett
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty