Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-99622

Memory allocation are bounded to long lived OperationContexts

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.1.0-rc0
    • Affects Version/s: 8.0.0
    • Component/s: None
    • Catalog and Routing
    • Fully Compatible
    • ALL
    • v8.0
    • CAR Team 2025-02-17
    • 0
    • 2

      In SERVER-88562, acquiredCollections and acquiredViews in the decoration TransactionResources got changed from std::List<> to inline_memory::List<>. The new container type is API compatible with std::List<>, but the allocation behavior changes drastically: it uses a MonotonicBufferResource as allocator, which is essentially a bump allocator for which the deallocation operation is a no-op. That means that the memory of removed elements from the list is not freed until the list itself is destroyed, which only happens when the OperationContext is destroyed. This is fine for short-lived OperationContexts, but there are some long lived examples like the one in the range deleter service, which essentially lives throughout the complete execution of the server, effectively creating a memory leak.

            Assignee:
            aitor.esteve@mongodb.com Aitor Esteve Alvarado
            Reporter:
            aitor.esteve@mongodb.com Aitor Esteve Alvarado
            Votes:
            0 Vote for this issue
            Watchers:
            22 Start watching this issue

              Created:
              Updated:
              Resolved: