32位centos 支持大内存 最大支持64G开启PAE

这用到了 kernel-PAE,首先介绍一下什么是 kernel-PAE?

操作系统在32bit x86平台上最大寻址空间只有4GB,如果要使用大于4GB的内存,就必须使用Intel的PAE(物理地址扩展)模式。在Windows NT平台实现PAE只需要对boot.ini加上/pae即可。而对于RHEL5/CentOS,缺省安装模式下是不允许检测超过4GB内存,所以我们需要在内核安装完毕后再安装kernel-PAE套件。

x86平台的硬件支持两级页表,Intel Pentium pro以上的型号均支持PAE和三级页表,使得系统最大寻址达到36位,就是64GB的内存。但是系统进程运行时使用的永远是虚拟地址,在32位字长的i386机器上,一个进程永远无法访问超出4G的字节。kernel只能通过拼凑的方式计算出大于4G的内存地址。 

在Linux kernel配置项里有High Memmory Support, 如果总内存小于等于1G的选"off",大于4G的选"64G" 
Note: Linux can use up to 64 Gigabytes of physical memory on x86 systems. However, the address space of 32-bit x86 processors is only 4 Gigabytes large. Thus means that, if you have a large amount of physical memory, not all of it can be "permanently mapped" by the kernel. The physical memory that's not permanently mapped is called "high memory". 
还有一项Allocate 3rd-level pagetables from highmem,使用这一项可以在内存很多(大于4G)的机器上将用户空间的页表放到高位内存区,以节约宝贵的低端内存。

具体如何操作才可以支持大内存?

1. yum install kernel-PAE

2. 安装好后,更改一下启动选项:
vi /boot/grub/grub.conf
如果看到类似如下代码 代表PAE内核已经安装好了
title CentOS (2.6.18-8.1.4.el5PAE)
        root (hd0,0)
        kernel /vmlinuz-2.6.18-8.1.4.el5PAE ro root=LABEL=/
        initrd /initrd-2.6.18-8.1.4.el5PAE.img
修改设置为默认启动
使 default=0

3.  重启服务器  init 6

二.

[root@http://www.ctohome.com]# free
total used free shared buffers cached
Mem: 3881968 637928 3244040 0 111292 461680
-/+buffers/cache: 64956 3817012
Swap: 4192924 0 4192924

[root@http://www.ctohome.com]# yum install kernel-PAE
Loaded plugins: fastestmirror
Loading mirror speeds fromcached hostfile
centos-burstnet | 1.1 kB 00:00 
updates-burstnet | 1.9 kB 00:00 
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package kernel-PAE.i6860:2.6.18-194.32.1.el5 set to be installed
--> Finished DependencyResolution

Dependencies Resolved

================================================================================================================================================================================
Package Arch Version Repository Size
================================================================================================================================================================================
Installing:
kernel-PAE i686 2.6.18-194.32.1.el5 updates-burstnet 17 M

Transaction Summary
================================================================================================================================================================================
Install 1 Package(s)
Upgrade 0 Package(s)

Total download size: 17 M
Is this ok [y/N]: y
Downloading Packages:
kernel-PAE-2.6.18-194.32.1.el5.i686.rpm | 17 MB 00:01 
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
Installing :kernel-PAE 1/1 

Installed:
kernel-PAE.i6860:2.6.18-194.32.1.el5 

Complete!
[root@http://www.ctohome.com]# free
total used free shared buffers cached
Mem: 3881968 637928 3244040 0 111292 461680
-/+buffers/cache: 64956 3817012
Swap: 4192924 0 4192924

[root@http://www.ctohome.com]# vi /boot/grub/grub.conf 
default=0 (把default=1改成default=0)
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS(2.6.18-194.32.1.el5PAE) (有这行PAE的就表示安装pae内核成功)
root (hd0,0)
kernel /vmlinuz-2.6.18-194.32.1.el5PAE ro root=LABEL=/
initrd /initrd-2.6.18-194.32.1.el5PAE.img
title CentOS(2.6.18-194.32.1.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-194.32.1.el5 ro root=LABEL=/
initrd /initrd-2.6.18-194.32.1.el5.img
title CentOS (2.6.18-194.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-194.el5 ro root=LABEL=/
initrd /initrd-2.6.18-194.el5.img

[root@http://www.ctohome.com]#reboot 

你可能感兴趣的:(支持大内存,最大支持64G开启PAE,32位centos)