简体   繁体   English

什么决定了进程可用的虚拟地址空间的大小?

[英]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 64 bit Address bus? 32 位与 64 位地址总线?

  2. 32 bit vs 64 bit Processor? 32 位与 64 位处理器?

  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.) ([编辑] 这是默认行为,但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 还具有可通过setrlimitgetrlimit访问的每进程资源限制 RLIMIT_AS 。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 进程的图形卡内存和虚拟地址空间 - Graphics card memory and virtual address space of a process 为什么进程的虚拟地址空间中有漏洞 - Why there are holes in the virtual address space of a process Linux进程虚拟地址空间的地址范围 - Linux process virtual address space's address range 位于进程虚拟地址空间中的其他线程的堆栈在哪里? - Where are the stacks for the other threads located in a process virtual address space? 一个虚拟地址空间中的进程线程如何进行内存管理? - How memory management happens for process threads in one virtual address space? 整个进程的虚拟地址空间是否分为页面 - Is an entire process’s virtual address space split into pages 虚拟地址空间 - Virtual Address Space linux pmap了解特定虚拟地址空间中正在运行的内容 - linux pmap understanding what is running in specific virtual address space 进程的虚拟地址范围 - Virtual address range of a process 如果是进程上下文切换,新进程的虚拟地址空间(VAS)是否已加载到CPU上下文(CPU的寄存器)中? - In case of a process context switch, is the virtual address space (VAS) of the new process loaded into the CPU context (CPU's registers)?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM