.net 6.0 container pods running in k8 cluster using a lot of memory. #4546
Replies: 1 comment
-
Yes! I highly recommend using Workstation GC for your microservices running on containers. However, before making any changes, it's important to check if your application has any memory leaks. You can easily obtain a memory dump by attaching to your pod if you are not using distroless linux. To attach to the pod, you can use the following command: kubectl exec -ti <pod-name> -- /bin/sh Once you have attached to the pod, you can obtain a memory dump using the following commands: # List all the current processes where a garbage collector dump can be obtained from
./dotnet-gcdump ps
# This command will create a dump for the given PID (in this case, 1)
./dotnet-gcdump collect -p 1
# Download the dump file from your pod to your local machine
kubectl cp <pod-name>:/tools/dotnet_20230331_163848.gcdump .\result.gcdump Please note that dotnet tool install --global dotnet-gcdump I hope this helps! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
We have 30 microservices deployed in k8 cluster and some services which are sitting in the cluster and doing nothing are using somewhere between 150-200 MB. The other ones which are CRUD API services are taking somewhere between 200 - 500 MB. I tried adding memory to one of the pod to 700mb and it started using 650 mb. I wanted to ask shall i change my GC to workstation? Any ideas.???
Beta Was this translation helpful? Give feedback.
All reactions