For a working definition,we've said that a process is a running program.This means that the operating system h-as loaded the executable file for the program into memory,has arranged for it to have access to its command-lin-e arguments and environment variables,and has started it running.A process has five conceptually different are-as of memory allocated to it:
Code:
Often referred to sa the text segment,this is the area in which the executable instructions reside.
Initialized data:
Statically allocated and global data that are initialized with nonzero values live in the data segment.
Zero-initialized data:
Global and statically allocated data that are initialized to zero by default are kept in what is colloquially called the SS area of the process.
Heap:
The heap is where dynamic memory(obtained by malloc() and friends)comes from.
Stack:
The stack segment is where local variables are allocated.
本文详细介绍了进程中的五种主要内存区域:代码段存放可执行指令;初始化数据段存放已初始化的全局变量;零初始化数据段存放默认初始化为零的数据;堆区通过动态分配内存获得;栈区用于局部变量的分配。

被折叠的 条评论
为什么被折叠?



