我正在尝试确认 OpenVZ vps 上的交换使用情况。 (我之前遇到过配置错误的交换文件的问题)
为此,我正在使用此问题中的代码慢慢填充内存 如何测试交换分区。
然后在运行代码时,使用 top 监视内存和交换使用情况。
运行时,交换使用量不会改变,而是 memeater 代码的使用量接近实际内存限制然后停止。
这是 OpenVZ 设置中交换文件的正常行为吗?
其他有用的信息- - - -
交换性 = 60
# uname -a
Linux vps.server.com 5.4.0 #1 SMP Mon Mar 16 15:39:59 MSK 2020 x86_64 x86_64 x86_64 GNU/Linux
# cat /proc/user_beancounters
Version: 2.5
uid resource held maxheld barrier limit failcnt
21423: kmemsize 48521216 101617664 9223372036854775807 9223372036854775807 0
lockedpages 93 149 9223372036854775807 9223372036854775807 0
privvmpages 175203 477143 9223372036854775807 9223372036854775807 0
shmpages 366 368 9223372036854775807 9223372036854775807 0
dummy 0 0 9223372036854775807 9223372036854775807 0
numproc 71 71 4194304 4194304 0
physpages 133247 262148 262144 262144 381
vmguarpages 0 0 9223372036854775807 9223372036854775807 0
oomguarpages 139011 276392 0 0 14
numtcpsock 0 0 9223372036854775807 9223372036854775807 0
numflock 6 104 9223372036854775807 9223372036854775807 0
numpty 1 4 9223372036854775807 9223372036854775807 0
numsiginfo 0 87 9223372036854775807 9223372036854775807 0
tcpsndbuf 0 0 9223372036854775807 9223372036854775807 0
tcprcvbuf 0 0 9223372036854775807 9223372036854775807 0
othersockbuf 0 0 9223372036854775807 9223372036854775807 0
dgramrcvbuf 0 0 9223372036854775807 9223372036854775807 0
numothersock 0 0 9223372036854775807 9223372036854775807 0
dcachesize 20279296 24981504 9223372036854775807 9223372036854775807 0
numfile 860 5590 9223372036854775807 9223372036854775807 0
dummy 0 0 9223372036854775807 9223372036854775807 0
dummy 0 0 9223372036854775807 9223372036854775807 0
dummy 0 0 9223372036854775807 9223372036854775807 0
numiptent 44 44 9223372036854775807 9223372036854775807 0