[英]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是吗
32 bit Vs 64 bit Address bus? 32 位与 64 位地址总线?
32 bit vs 64 bit Processor? 32 位与 64 位处理器?
Secondary storage available?二级存储可用吗?
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.) ([编辑] 这是默认行为,但vm.overcommit_memory sysctl 设置可用于阻止映射没有可用 RAM 或交换的 VM 页面。搜索该 sysctl 设置以获取更多信息。)
The CPU certainly puts an upper limit, and that is essentially the only limit on 64-bit systems. CPU 肯定设置了一个上限,而这本质上是 64 位系统的唯一限制。 Although note that current x86_64 processors do not actually let you use the entire 64-bit space .尽管请注意当前的x86_64 处理器实际上并没有让您使用整个 64 位空间。
On 32-bit Linux, things get more complicated.在 32 位 Linux 上,事情变得更加复杂。 Older versions of Linux reserved 2GB of virtual space of each process for the kernel;旧版本的Linux为kernel保留每个进程2GB的虚拟空间; newer ones reserve 1GB.较新的保留 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. (如果 memory 服务,也就是说。我相信在编译 kernel 时这些是可配置的。)您是否认为该空间“可用于进程”是语义问题。
Linux also has a per-process resource limit RLIMIT_AS accessible via setrlimit and getrlimit . Linux 还具有可通过setrlimit和getrlimit访问的每进程资源限制 RLIMIT_AS 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.