이 콘텐츠는 선택한 언어로 제공되지 않습니다.

15.2. Linux Memory Layout


The 4 GB address space in 32 bit x86 Linux is usually split into different sections for every process on the system:
  • 0GB-1GB User space - Used for text, code and brk/sbrk allocations. malloc uses brk for small chunks.
  • 1GB-3GB User space - Used for shared libraries, shared memory, and the stack. Shared memory and malloc use mmap. malloc uses mmap for large chunks.
  • 3GB-4GB Kernel Space - Used by and for the kernel itself
In older Linux systems the split between brk(2) and mmap(2) was changed by setting the kernel parameter TASK_UNMAPPED_BASE and by recompiling the kernel. However, on all Red Hat Enterprise Linux systems this parameter can be changed dynamically as will be shown later. The mmap allocated memory grow bottom up from 1GB and the stack grows top down from around 3GB. The split between userspace and kernelspace is set by the kernel parameter PAGE_OFFSET which is usually 0xc0000000 (3GB).
By default, in Red Hat Enterprise Linux 2.1 the address space between 0x40000000 (1 GB) and 0xc0000000 (3 GB) is available for mapping shared libraries and shared memory segments. The default mapped base for loading shared libraries is 0x40000000 (1 GB) and the SGA attach address for shared memory segments is above the shared libraries. In Oracle 9i on Red Hat Enterprise Linux 2.1 the default SGA attach address for shared memory is 0x50000000 (1.25 GB) where the SGA is mapped. This leaves 0.25 GB space for loading shared libraries between 0x40000000 (1 GB) and 0x50000000 (1.25 GB).
The address mappings of processes can be checked by viewing the proc file /proc/<pid>/maps where pid stands for the process ID. Here is an example of a default address mapping of an Oracle 9i process in Red Hat Enterprise Linux 2.1:
08048000-0ab11000 r-xp 00000000 08:09 273078 /ora/product/9.2.0/bin/oracle
0ab11000-0ab99000 rw-p 02ac8000 08:09 273078 /ora/product/9.2.0/bin/oracle
0ab99000-0ad39000 rwxp 00000000 00:00 0
40000000-40016000 r-xp 00000000 08:01 16     /lib/ld-2.2.4.so
40016000-40017000 rw-p 00015000 08:01 16     /lib/ld-2.2.4.so
40017000-40018000 rw-p 00000000 00:00 0
40018000-40019000 r-xp 00000000 08:09 17935  /ora/product/9.2.0/lib/libodmd9.so
40019000-4001a000 rw-p 00000000 08:09 17935  /ora/product/9.2.0/lib/libodmd9.so
4001a000-4001c000 r-xp 00000000 08:09 16066  /ora/product/9.2.0/lib/libskgxp9.so
...
42606000-42607000 rw-p 00009000 08:01 50     /lib/libnss_files-2.2.4.so
50000000-50400000 rw-s 00000000 00:04 163842 /SYSV00000000 (deleted)
51000000-53000000 rw-s 00000000 00:04 196611 /SYSV00000000 (deleted)
53000000-55000000 rw-s 00000000 00:04 229380 /SYSV00000000 (deleted)
...
bfffb000-c0000000 rwxp ffffc000 00:00 0
Copy to Clipboard Toggle word wrap
As this address mapping shows, shared libraries start at 0x40000000 (1 GB) and System V shared memory, in this case SGA, starts at 0x50000000 (1.25 GB). Here is a summary of all the entries:
The text (code) section is mapped at 0x08048000:
08048000-0ab11000 r-xp 00000000 08:09 273078  /ora/product/9.2.0/bin/oracle
Copy to Clipboard Toggle word wrap
The data section is mapped at 0x0ab11000:
0ab11000-0ab99000 rw-p 02ac8000 08:09 273078  /ora/product/9.2.0/bin/oracle
Copy to Clipboard Toggle word wrap
The uninitialized data segment .bss is allocated at 0x0ab99000:
0ab99000-0ad39000 rwxp 00000000 00:00 0
Copy to Clipboard Toggle word wrap
The base address for shared libraries is 0x40000000:
40000000-40016000 r-xp 00000000 08:01 16      /lib/ld-2.2.4.so
Copy to Clipboard Toggle word wrap
The base address for System V shared memory, in this case SGA, is 0x50000000:
50000000-50400000 rw-s 00000000 00:04 163842  /SYSV00000000 (deleted)
Copy to Clipboard Toggle word wrap
The stack is allocated at 0xbfffb000:
bfffb000-c0000000 rwxp ffffc000 00:00 0
Copy to Clipboard Toggle word wrap
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat