1
votes

Sorry for my poor english.

I'm tuning java vm that work in k8s pod.

Normally java vm shouldn't use all memory. Some memory should used by kernel for cache, buffer, resource management and so on. I knew container share host os kernel. The question is Does resource limit of pods include kernel memory such as file cache.

Thanks.

2

2 Answers

1
votes

As the question you asked, I assumed you have searched about how to setup limitation for Memory in K8S -> https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/#how-pods-with-resource-limits-are-run

In this section you will know the limitation you set would be convert to docker command(if you use docker in k8s), spec.containers[].resources.limits.memory -> --memory=""

and if you check the official document about kernel memory in docker -> https://docs.docker.com/config/containers/resource_constraints/#--kernel-memory-details which hasnt mentioned in k8s document. So I assume the value should be the default value for different type of linux system.

0
votes

No, those kinds of buffers are not tracked per process and so are not bound by cgroups settings. I think the vfs cache specifically is shared globally after namespace processing but not 100% sure.