我们的一台服务器已安装 8G 内存。但显示只有 3.2G。粘贴信息以供进一步分析。
=========
[root@s209 ~]# free -m
total used free shared buffers cached
Mem: 3289 879 2409 0 37 669
-/+ buffers/cache: 173 3115
Swap: 4094 0 4094
[root@s209 ~]#
[root@s209 ~]# cat /proc/meminfo
MemTotal: 3368192 kB
MemFree: 2482456 kB
Buffers: 38144 kB
Cached: 685216 kB
SwapCached: 0 kB
Active: 413112 kB
Inactive: 435088 kB
HighTotal: 2488768 kB
HighFree: 1669300 kB
LowTotal: 879424 kB
LowFree: 813156 kB
SwapTotal: 4192956 kB
SwapFree: 4192956 kB
Dirty: 1596 kB
Writeback: 0 kB
AnonPages: 124788 kB
Mapped: 17104 kB
Slab: 24928 kB
PageTables: 3840 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
CommitLimit: 5877052 kB
Committed_AS: 389964 kB
VmallocTotal: 114680 kB
VmallocUsed: 5536 kB
VmallocChunk: 109028 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
Hugepagesize: 4096 kB
=========
[root@s209 ~]# uname -r
2.6.18-194.el5
=========
=========
[root@s209 ~]# dmesg | less
Linux version 2.6.18-194.el5 ([email protected]) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)) #1 SMP Fri Apr 2 14:58:35 EDT 2010
BIOS-provided physical RAM map:
BIOS-e820: 0000000000010000 - 000000000009dc00 (usable)
BIOS-e820: 000000000009dc00 - 00000000000a0000 (reserved)
BIOS-e820: 00000000000e0000 - 0000000000100000 (reserved)
BIOS-e820: 0000000000100000 - 00000000cfe70000 (usable)
BIOS-e820: 00000000cfe70000 - 00000000cfe7d000 (ACPI data)
BIOS-e820: 00000000cfe7d000 - 00000000cfe80000 (ACPI NVS)
BIOS-e820: 00000000cfe80000 - 00000000d0000000 (reserved)
BIOS-e820: 00000000e0000000 - 00000000f0000000 (reserved)
BIOS-e820: 00000000fec00000 - 00000000fed00000 (reserved)
BIOS-e820: 00000000fee00000 - 00000000fee01000 (reserved)
BIOS-e820: 00000000ff000000 - 0000000100000000 (reserved)
BIOS-e820: 0000000100000000 - 0000000230000000 (usable)
Warning only 4GB will be used.
Use a PAE enabled kernel.
3200MB HIGHMEM available.
896MB LOWMEM available.
=========
=========
[root@s209 ~]# dmidecode -t 17
# dmidecode 2.10
SMBIOS 2.5 present.
Handle 0x0013, DMI type 17, 27 bytes
Memory Device
Array Handle: 0x0012
Error Information Handle: No Error
Total Width: 40968 bits
Data Width: 41024 bits
Size: 2048 MB
Form Factor: DIMM
Set: 1
Locator: J6G1
Bank Locator: DIMM 0
Type: DDR2
Type Detail: Synchronous
Speed: 667 MHz
Manufacturer: Hyundai Electronics
Serial Number: 4121C2C5
Asset Tag: 41410933
Part Number: 48594D503132355536344350382D53362020
Handle 0x0014, DMI type 17, 27 bytes
Memory Device
Array Handle: 0x0012
Error Information Handle: No Error
Total Width: 41480 bits
Data Width: 41536 bits
Size: 2048 MB
Form Factor: DIMM
Set: 1
Locator: J6G2
Bank Locator: DIMM 1
Type: DDR2
Type Detail: Synchronous
Speed: 667 MHz
Manufacturer: Unknown
Serial Number: 00000000
Asset Tag: 00000000
Part Number: 000000000000000000000000000000000000
Handle 0x0015, DMI type 17, 27 bytes
Memory Device
Array Handle: 0x0012
Error Information Handle: No Error
Total Width: 41992 bits
Data Width: 42048 bits
Size: 2048 MB
Form Factor: DIMM
Set: 1
Locator: J6H1
Bank Locator: DIMM 2
Type: DDR2
Type Detail: Synchronous
Speed: 667 MHz
Manufacturer: Princeton Technology
Serial Number: 100916C6
Asset Tag: 00000A37
Part Number: 5052494E4345544F4E000000000000000000
Handle 0x0016, DMI type 17, 27 bytes
Memory Device
Array Handle: 0x0012
Error Information Handle: No Error
Total Width: 42504 bits
Data Width: 42560 bits
Size: 2048 MB
Form Factor: DIMM
Set: 1
Locator: J6H2
Bank Locator: DIMM 3
Type: DDR2
Type Detail: Synchronous
Speed: 667 MHz
Manufacturer: Unknown
Serial Number: 00000000
Asset Tag: 00000000
Part Number: 000000000000000000000000000000000000
=========
任何有助于解决此问题的帮助都将非常有帮助。
诚挚的,阿乔
答案1
如果您运行uname -a
,您很可能会发现您正在运行 32 位内核。 PAE(物理地址扩展)允许内核扩展可以寻址的内存量以达到更大的数字。
您需要切换到启用 PAE 的内核。您可以重新编译,或者...yum install kernel-pae
然后切换到从该内核启动。
祝你好运!
答案2
正如 Redmumba 所建议的,您几乎肯定正在运行 32 位内核。
除了 PAE 选项,您还可以愉快地运行带有 32 位用户空间的 64 位内核 - 这与 PAE 具有类似的效果,因为整个系统可以使用 64 位地址空间,但各个进程(除非它们明确支持 PAE)被限制在 32 位地址空间。如果我没记错的话,64 位内核和 32 位进程之间的上下文切换比 PAE 造成的瓶颈要小,因此您可能会发现此选项更高效。我不知道 CentOS 的情况,但使用 Debian 您只需运行aptitude install linux-image-amd64
(来自http://packages.debian.org/squeeze/linux-image-amd64这个虚拟包及其依赖项对于 amd64 和 i386 版本都存在),它将为您完成工作(并且自动更新将顺利完成,因为您没有手动编译任何东西,而是使用包管理系统)。
如果这是一个全新的设置(即操作系统刚刚安装而不是刚刚升级现有服务器上的 RAM),那么我建议使用完整的 64 位设置(用户空间和内核)进行完全重新安装。
答案3
是的,操作系统是32位的。
Linux s209.xxxxx.net 2.6.18-194.el5 #1 SMP 2010 年 4 月 2 日星期五 14:58:35 EDT i686 i686 i386 GNU/Linux