Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-35557

MemoryManager only reserves memory per consumer type once

    XMLWordPrintableJSON

Details

    Description

      1. In MemoryManager.getSharedMemoryResourceForManagedMemory we create a reserve function
      2. The function decrements the available Slot memory and fails if there's not enough memory
      3. We pass it to SharedResources.getOrAllocateSharedResource
      4. In SharedResources.getOrAllocateSharedResource , we check if the resource (memory) was already reserved by some key (e.g. state-rocks-managed-memory)
      5. If not, we create a new one and call the reserve function
      6. If the resource was already reserved (not null), we do NOT reserve the memory again: https://github.com/apache/flink/blob/57869c11687e0053a242c90623779c0c7336cd33/flin[…]/main/java/org/apache/flink/runtime/memory/SharedResources.java

      So there will be only one (first) memory reservation for rocksdb for example, no matter how many state backends in a slot are created. Meaning that managed memory limits are not applied

      Attachments

        Activity

          People

            roman Roman Khachatryan
            roman Roman Khachatryan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: