Skip to content

High Memory usage due to SlabMemoryPool #9627

@alkampfergit

Description

@alkampfergit

Dear Orleans Team,

We are in .NET 9 Orleans 9.0.1

we have a software that is running with Microsoft orleans, actually it is a single node instance and in one of the installation we started seeing anomaly RAM usage, the process start using several GB of RAM.

Doing a dump we found that we have more than one millions instances of Orleans.Networking.Shared.MemoryPoolBlock

Image

And following the Roots in the Heap we found that the class holding reference is SlabMemoryPool. We look in the heap and we found 35k instances of MemoryPoolSlab (each one using 128 k of memory)

Image

Actually we are investigating on what could be the cause, but if I'm reading the code correctly the SlabMemoryPool will always allocate new slabs if there is not an available block in the pool, so the RAM usage grow and was never returned back. Supposing we surely have some problem somewhere else and we have a moment in which some piece of code ask for too many MemoryPoolBlock for the SlabMemoryPool the memory will never be given back to the garbage collector.

How can I better investigate the problem?

Is there a known workaround to free the memory? (Actually when the allocation is really high the server goes in out-of-memory-exception)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions