我有一个运行在VMWare上的CentOS 5.10( 32位 )服务器。 它分配了4 GB的RAM。
如果我运行dmidecode -t 17 | grep Size | grep MB dmidecode -t 17 | grep Size | grep MB dmidecode -t 17 | grep Size | grep MB我看到:
Size: 4096 MB
然而,当我free奔跑时,我看到:
total used free shared buffers cached Mem: 3107140 1239244 1867896 0 332 400464 -/+ buffers/cache: 838448 2268692 Swap: 2096472 0 2096472
为什么无记忆内存总量和dmidecode输出之间有差异?
我正在运行的内核是:
2.6.18-371.4.1.el5 #1 SMP Thu Jan 30 06:09:24 EST 2014 i686 i686 i386 GNU/Linux
无可否认,内核并没有运行PAE但我认为这只是超过 4 GB的内存所必需的。
我知道我错过了一些简单的东西 – 有人可以详细说明吗?
这绝对看起来像我的内核为其他东西保留一堆内存。 以下是我在/var/log/dmesg看到的内容:
Linux version 2.6.18-371.4.1.el5 (mockbuild@builder17.centos.org) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-54)) #1 SMP Thu Jan 30 06:09:24 EST 2014 BIOS-provided physical RAM map: BIOS-e820: 0000000000010000 - 000000000009f800 (usable) BIOS-e820: 000000000009f800 - 00000000000a0000 (reserved) BIOS-e820: 00000000000ca000 - 00000000000cc000 (reserved) BIOS-e820: 00000000000dc000 - 0000000000100000 (reserved) BIOS-e820: 0000000000100000 - 00000000bfef0000 (usable) BIOS-e820: 00000000bfef0000 - 00000000bfeff000 (ACPI data) BIOS-e820: 00000000bfeff000 - 00000000bff00000 (ACPI NVS) BIOS-e820: 00000000bff00000 - 00000000c0000000 (usable) BIOS-e820: 00000000e0000000 - 00000000f0000000 (reserved) BIOS-e820: 00000000fec00000 - 00000000fec10000 (reserved) BIOS-e820: 00000000fee00000 - 00000000fee01000 (reserved) BIOS-e820: 00000000fffe0000 - 0000000100000000 (reserved) BIOS-e820: 0000000100000000 - 0000000140000000 (usable) Warning only 4GB will be used. Use a PAE enabled kernel. 3200MB HIGHMEM available. 896MB LOWMEM available. found SMP MP-table at 000f6bf0 Memory for crash kernel (0x0 to 0x0) notwithin permissible range
使用32位内核,您只有4GB的可用地址空间 。 这些地址空间中的一些必须由系统中的(虚拟或物理)硬件使用,例如video卡,NIC等,用于他们自己的目的。 这个用法通常在256MB-1GB之间,具体取决于特定硬件需要多less地址空间。
由于该地址空间被硬件使用,所以相应的RAM通常对于32位系统是不可访问的。
你有几个select:
free命令的输出不会保留内核内存和其他一些小的内存。 即使在64位的内核中,甚至在2GB的内存下,你也会看到这种差异。
从你的物理RAM地图的关键线是这样的:
BIOS-e820: 0000000100000000 - 0000000140000000 (usable)
此行显示您的系统的物理RAM的1 GB(0x40000000字节,hex)正被超过4GB限制的BIOS映射,使其无法通过没有PAE的32位系统访问。