How do I find the total available physical memory on a computer specifically running Ubuntu and .NET core? Most solutions work only on full .NET and the following .NET core code snippet --
ManagementClass mc = new ManagementClass ("Win32_ComputerSystem");
ManagementObjectCollection moc = mc.GetInstances();
foreach (ManagementObject item in moc)
m1 = Convert.ToUInt64(item.Properties["TotalPhysicalMemory"].Value);
works properly on Windows but returns 0 on non-Windows systems.