昨天破血本升级VPS到了 2G 内存; 然后就无意发现 free -m 命令显示的不是 2048M
1 2 3 4 | total used free shared buffers cached Mem: 2001 1614 387 64 96 1011 -/+ buffers/cache: 507 1494 Swap: 255 0 255 |
total used free shared buffers cached Mem: 2001 1614 387 64 96 1011 -/+ buffers/cache: 507 1494 Swap: 255 0 255
htop 命令也明显写的是 2000M 左右
Mem[|||||||||||||||###****************************513/2001MB]
大概是 2000M ,我以为是 QuickHostUK 不厚道,认为 1G = 1000M 但是搞IT的都知道应该用 1024,虽然其实差别也就50M 左右的内存,但是心理很不爽.于是我联系 QuickHostUK;经过一晚上的研究,他们说
1 2 3 4 5 6 7 8 9 10 | Hi, Sir system reserves some memory. Its not an error. Checking a 4GB (4096MB) vps we see 3820MB. This is kvm virtual server container not a hardware server. Please let us know if you need any further information. |
Hi, Sir system reserves some memory. Its not an error. Checking a 4GB (4096MB) vps we see 3820MB. This is kvm virtual server container not a hardware server. Please let us know if you need any further information.
然后我就上网找了一些资料:发现这些命令都是显示可用内存总量并不是物理内存总量.
1 2 3 4 5 6 7 8 9 10 11 | root@uploadbeta:/home# cat /proc/meminfo | head MemTotal: 2049908 kB MemFree: 388968 kB Buffers: 99104 kB Cached: 1048948 kB SwapCached: 0 kB Active: 552664 kB Inactive: 985708 kB Active(anon): 220912 kB Inactive(anon): 235604 kB Active(file): 331752 kB |
root@uploadbeta:/home# cat /proc/meminfo | head MemTotal: 2049908 kB MemFree: 388968 kB Buffers: 99104 kB Cached: 1048948 kB SwapCached: 0 kB Active: 552664 kB Inactive: 985708 kB Active(anon): 220912 kB Inactive(anon): 235604 kB Active(file): 331752 kB
2049908 kB 也是 2001M; 然后这个命令显示了系统总的物理内存.这些信息每次开机都会被记录.
1 2 | root@uploadbeta:/home# cat /var/log/dmesg | grep Memory [ 0.000000] Memory: 2041296K/2096748K available (7338K kernel code, 1138K rwdata, 3388K rodata, 1332K init, 1440K bss, 55452K reserved) |
root@uploadbeta:/home# cat /var/log/dmesg | grep Memory [ 0.000000] Memory: 2041296K/2096748K available (7338K kernel code, 1138K rwdata, 3388K rodata, 1332K init, 1440K bss, 55452K reserved)
就有显示 总量是 2048M = 2096748K 有一些是系统保留的.
下面的命令 dmidecode -t 17 更清楚的显示物理内存总量:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | root@uploadbeta:/home# dmidecode -t 17 # dmidecode 2.12 SMBIOS 2.4 present. Handle 0x1100, DMI type 17, 21 bytes Memory Device Array Handle: 0x1000 Error Information Handle: 0x0000 Total Width: 64 bits Data Width: 64 bits Size: 2048 MB Form Factor: DIMM Set: None Locator: DIMM 0 Bank Locator: Not Specified Type: RAM Type Detail: None |
root@uploadbeta:/home# dmidecode -t 17 # dmidecode 2.12 SMBIOS 2.4 present. Handle 0x1100, DMI type 17, 21 bytes Memory Device Array Handle: 0x1000 Error Information Handle: 0x0000 Total Width: 64 bits Data Width: 64 bits Size: 2048 MB Form Factor: DIMM Set: None Locator: DIMM 0 Bank Locator: Not Specified Type: RAM Type Detail: None
好吧,我有点钻牛角尖了,因为自己掏的每一分钱都需要得到回报.
强烈推荐
- 英国代购-畅购英伦
- TopCashBack 返现 (英国购物必备, 积少成多, 我2年来一共得了3000多英镑)
- Quidco 返现 (也是很不错的英国返现网站, 返现率高)
- 注册就送10美元, 免费使用2个月的 DigitalOcean 云主机(性价比超高, 每月只需5美元)
- 注册就送10美元, 免费使用4个月的 Vultr 云主机(性价比超高, 每月只需2.5美元)
- 注册就送10美元, 免费使用2个月的 阿里 云主机(性价比超高, 每月只需4.5美元)
- 注册就送20美元, 免费使用4个月的 Linode 云主机(性价比超高, 每月只需5美元) (折扣码: PodCastInit2022)
- PlusNet 英国光纤(超快, 超划算! 用户名 doctorlai)
- 刷了美国运通信用卡一年得到的积分 换了 485英镑
- 注册就送50英镑 – 英国最便宜最划算的电气提供商
- 能把比特币莱特币变现的银行卡! 不需要手续费就可以把虚拟货币法币兑换
微信公众号: 小赖子的英国生活和资讯 JustYYUK