我使用 LXC 虚拟化技术对操作系统进行了虚拟化。该系统报告了错误的可用内存 - 它始终与空闲内存相同。通过实验,我能够使用比报告的可用内存量更多的内存,因此我确信可用内存的计算是错误的。
可以修复此问题吗?我无法更改虚拟化类型,但可以更改配置。
主机:Ubuntu 16.04
客户机:Ubuntu 16.044.4.0-22-generic #39-Ubuntu SMP Thu May 5 16:53:32 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
cat /proc/meminfo
MemTotal: 2048448 kB
MemFree: 1382508 kB
MemAvailable: 1382508 kB
Buffers: 0 kB
Cached: 418400 kB
SwapCached: 0 kB
Active: 971248 kB
Inactive: 687476 kB
Active(anon): 333484 kB
Inactive(anon): 414684 kB
Active(file): 637764 kB
Inactive(file): 272792 kB
Unevictable: 0 kB
Mlocked: 0 kB
SwapTotal: 2095100 kB
SwapFree: 2017328 kB
Dirty: 168 kB
Writeback: 0 kB
AnonPages: 528524 kB
Mapped: 251992 kB
Shmem: 210652 kB
Slab: 0 kB
SReclaimable: 165148 kB
SUnreclaim: 24392 kB
KernelStack: 5456 kB
PageTables: 18800 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 3119324 kB
Committed_AS: 2141108 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 0 kB
VmallocChunk: 0 kB
HardwareCorrupted: 0 kB
AnonHugePages: 69632 kB
CmaTotal: 0 kB
CmaFree: 0 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
DirectMap4k: 210936 kB
DirectMap2M: 1886208 kB
答案1
遗憾的是,没有找到具体原因。更新 lxc、lxd 软件包并重新启动服务器可以解决问题。我希望这能永久解决。