Closed glucaci closed 3 months ago
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.
Only by mapping the sharefs
also to cgroup V1
return new DriveInfo(SysFsCgroupFileSystemPath).DriveFormat switch
{
"cgroup2fs" => CGroupVersion.CGroup2,
"tmpfs" or "sharefs" => CGroupVersion.CGroup1,
_ => CGroupVersion.None,
};
seams everything to work as expected.
DriveFormat: sharefs
MaxWorkingSet: 1073741824
There are any news?
This should have been fixed by #99508 in .NET 9 Preview 6.
Description
When trying to use the
Process.GetCurrentProcess().MaxWorkingSet
on a linux host, it's using underlining thecgroup
V1 or V2. In code and also on the Kubernetes docs it's only specifycgroup2fs
andtmpfs
.When I did a test on our AKS cluster I receive as
DriverFormat
thesharefs
which make than theMaxWorkingSet
will be alwayslong.MaxValue
.Trying to debug it locally in a normal container on Docker it's also
sharefs
.Following the Kubernetes docs to identify the cgroup version it's
tmpfs
.Reproduction Steps
Create new console app, add docker support for linux, add docker run args
--memory=1g
and use the following code:Expected behavior
MaxWorkingSet
should be equal with the output fromcat /sys/fs/cgroup/memory/memory.limit_in_bytes
Actual behavior
MaxWorkingSet
is falling back tolong.MaxValue
becausesharefs
is not supported. Interop.cgroups.csRegression?
No response
Known Workarounds
No response
Configuration
.NET 7
AKS with Kubernetes v1.24.6 Docker Desktop 4.15.0
base image used for demo application
mcr.microsoft.com/dotnet/runtime:7.0
Other information
No response