32 位 RHEL 機器上的內存使用 (Memory use on 32 bit RHEL machine)


問題描述

32 位 RHEL 機器上的內存使用 (Memory use on 32 bit RHEL machine)

I am using 32 bit RHEL 4.4 on AMD64 based hardware. Here is the output from uname ‑a

$ uname ‑a
Linux zulu 2.6.9‑42.0.10.ELsmp #1 SMP Fri Feb 16 17:17:21 EST 2007 i686 athlon i386 GNU/Linux

I have 8Gigs of memory installed on this system, OS being 32 bits I would assume that my system will not be able to make use of full 8GB memory. But when I run top, I see the following ‑

Mem:   8309168k total,  8292028k used,    17140k free,     7096k buffers

So, top  is able to view all 8GB of memory. 

If I install 32 bit WinXP in same machine, task manager just shows 3 GB as available.

My question is ‑ How is 32 bit OS able to see 8GB memory? Does this mean that my applications will be able to use larger address space? And why is the difference between 32 bit Linux and 32 bit WinXP?

Thanks!

‑‑‑‑‑

參考解法

方法 1:

Your Linux system supports Physical Address Extension.

方法 2:

There are different 'levels' of memory. What is impossible, whatever the OS, is to address more than 4Gb in one process, since your pointers are too small for more than that ‑ that's the fundamental limitation of 32 bits w.r.t memory. On linux and windows, and most 'traditional' OSs I would guess, the 32 bits virtual address space is split into one part for the kernel and one part for the process, so you get less than 4 Gb of addressable content for each process.

But still, the OS could use more than 4 Gb ‑ for example, having 2‑3 processes each consuming 2 Gb of memory. Even 32 bits CPU can address more than 4 Gb of memory (at the hardware level), but in the virtual address space, you are always limited by your 32 bits pointers.

The old new thing has a good explanation on the differences between physical address space, virtual address space and co: http://blogs.msdn.com/oldnewthing/archive/2004/08/18/216492.aspx

方法 3:

The method enabling this is called "PAE" (Physical address extension). Your CPU is able to use 36bit addresses internally, and your OS supports it. Unfortunately, Windows XP only uses PAE in order to support the NX bit (No eXecution bit, causes an exception to occur when the processor tries to execute code from a page marked with this bit). 32bit Linux kernels support PAE.

方法 4:

Newer i386‑compatible CPUs can address more than 4 GB using PAE mode.  Windows XP artificially limits the address space to 4GB because there are too many poorly written hardware drivers that assume all DMA is will be done to memory below 4 GB.  So, about 1 GB of the 4 GB address space is mapped to hardware, the rest to physical RAM. Windows server editions don't have this limitation.  Linux kernels that support PAE don't limit memory either.  Both of these support up to 32GB, if I remember correctly.

Your application is limited to somewhere between 2‑3 GB of address space, depending on OS options.  One application can effectively use more physical RAM than that by windowing portions of memory in and out of that address space, using address windowing extensions, or memory mapped files, for example.

(by spkhairaKristof ProvostDavid CournapeauASkkarunski)

參考文件

  1. Memory use on 32 bit RHEL machine (CC BY‑SA 3.0/4.0)

#32-bit #memory #linux






相關問題

內聯彙編 - cdecl 和準備堆棧 (Inline assembly - cdecl and preparing the stack)

來自 32 位用戶代碼的 64 位系統中的 ioctl 命令錯誤 (ioctl command wrong in 64 bit system from 32 bit user code)

Baiklah, PR: Bagaimana mungkin X[i] diinterpretasikan sama dengan i[X] di C? (Alright, homework: How can X[i] possibly be interpretted the same as i[X] in C?)

x32 ABI - гэта інструмент, як ім карыстацца (x32 ABI is this a tool ,how to use this)

Biên dịch Visual Studio 2012 32bit trên hệ thống 64bit (Visual Studio 2012 32bit compilation on 64bit system)

如何讓 Netbeans 7.2 使用 32 位 JVM (How get Netbeans 7.2 to use 32 Bit JVM)

反彙編代碼中的數組聲明 (Declaration of an array in disassembled code)

用C編寫跨平台應用程序 (Writing cross-platform apps in C)

為什麼 BinaryReader.ReadUInt32() 反轉位模式? (Why does BinaryReader.ReadUInt32() reverse the bit pattern?)

32 位 RHEL 機器上的內存使用 (Memory use on 32 bit RHEL machine)

將 32 位應用程序安裝到 C:\Program Files\ 而不是 C:\Program Files(x86)\ 會有什麼負面影響? (What would be the negative effects of installing a 32bit app into the C:\Program Files\ instead of the C:\Program Files(x86)\?)

Arduino 將浮點數轉換為十六進制 IEEE754 單精度 32 位 (Arduino convert float to hex IEEE754 Single precision 32-bit)







留言討論