开发者

What decides the size of virtual address space available for a process?

What is the limitation on the virtual address space available to a process ?

Is it

  1. 32 bit Vs 6开发者_运维百科4 bit Address bus ?

  2. 32 bit vs 64 bit Processor ?

  3. Secondary storage available ?

  4. Maximum swap space configured ?

Thanks in advance


Secondary storage / swap space have nothing to do with it, because pages can be mapped into your address space without being allocated. And the same page can be mapped at multiple virtual addresses. ([edit] This is the default behavior, but the vm.overcommit_memory sysctl setting can be used to prevent the mapping of VM pages for which there is no RAM or swap available. Do a search on that sysctl setting for more information.)

The CPU certainly puts an upper limit, and that is essentially the only limit on 64-bit systems. Although note that current x86_64 processors do not actually let you use the entire 64-bit space.

On 32-bit Linux, things get more complicated. Older versions of Linux reserved 2GB of virtual space of each process for the kernel; newer ones reserve 1GB. (If memory serves, that is. I believe these are configurable when the kernel is compiled.) Whether you consider that space "available to a process" is a matter of semantics.

Linux also has a per-process resource limit RLIMIT_AS accessible via setrlimit and getrlimit.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜