Tim DeschryverTim

Reduce memory usage of .NET services on a single machine

The .NET logo
@tim_deschryver

Reduce memory usage of .NET services on a single machine

Use case

You see the memory consumption of multiple services growing and it doesn't decrease over time. After profiling the service you notice the memory of the service is released (there's no memory leak), but the unmanaged memory keeps on growing.

The Solution

When multiple containerized .NET API's are published on one machine, it might be more performant to disable the server garbage collection. This might lead to more CPU usage (in our case this wasn't the case, or it was very minimal), but it will help to reduce the memory usage.

See the docs for more details.

Support me

I appreciate it if you would support me if have you enjoyed this post and found it useful, thank you in advance.

Buy Me a Coffee at ko-fi.com PayPal logo
Support the blog Share on Twitter Discuss on Twitter Edit on GitHub