Skip to content

Is it possible to run dotnet-docker based containers with memory limits? #220

@geoffpatehutch

Description

@geoffpatehutch

I'm trying to use a dotnet-docker based container in a limited memory environment. I am passing --memory 134217728 (128MB) and --memory-swap=0 on the docker command line via DC/OS running on Ubuntu in the Azure Container Service.

The problem I have is that the .NET garbage collector is not doing what I expect. I have a simple timer that reloads data from a database creating small amounts of garbage regularly. I can see the memory usage increase until the container is killed due to OOM constraints. I would have expected the garbage collector to free up memory before this happened.

I am wondering if the container believes it has access to as much memory as the container host (3.5GB) and therefore isn't scheduling garbage collection as it feels under no pressure?

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