内核内存地址空间

发布于 2024-10-18 01:55:51 字数 122 浏览 3 评论 0原文

我读到,在具有 4GB 系统内存的 32 位系统上,2GB 分配给用户模式,2GB 分配给内核模式。但是,如果我有一个具有 512 MB 内存的系统,是否会将其划分为 256 MB 给用户地址空间和 256 MB 给内核地址空间?

I've read that, on a 32-bit system with 4GB system memory, 2GB is allocated to user mode and 2GB allocated to kernel mode. But, If I had a system with 512 MB of memory, would it be partitioned as 256 MB to user and 256 MB to kernel address space?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

背叛残局 2024-10-25 01:55:51

您混淆了物理内存和虚拟内存。 2GB分配给用户/系统,但它是虚拟内存。更正确的说法是,它们并不是被分配的,而是构成了一个寻址空间。最初这个空间根本不绑定到物理内存。当应用程序实际需要内存时(第一次是在启动时)分配物理内存并将地址空间中的一些地址映射到它。当内存已分配但使用时间不够长或 PC 物理内存不足时,数据可以转储到交换文件中,并保留在那里直到请求为止。这种映射对于应用程序来说是透明的,并且它不知道数据当前位于何处:在芯片上还是在 HDD 上。因此地址空间总是以相同的方式划分。

You are confusing physical and virtual memory. 2GB is allocated to user/system, but it is virtual memory. It is even more correct to say that they are not rather allocated but they constitute an addressing space. Initially this space is not bound to physical memory at all. When application actually needs memory (first time is at start up) physical memory is allocated and some addresses from address space are mapped to it. When memory is allocated but not used long enough or PC is running out of physical memory data can be dumped in swap file, and stay there until requested. This mapping is transparent for application and it has no idea where data currently is: on chip or on HDD. So the address space is always splitted the same way.

一百个冬季 2024-10-25 01:55:51

这与内存(物理或虚拟)无关,而是与地址空间有关。

您可以将 16GB 物理内存插入计算机并创建 100GB 交换文件,但 32 位(非企业)Windows 仍然只能看到 4GB(并减去 GPU 内存等 0.75GB)。通过 PAE,它可以使用更多,但非企业版本不会这样做。

除了实际内存量之外,还有地址空间,该空间也限制为 4GB。基本上,它只不过是可以用 32 位数字表示的“数字”(在本例中为地址)的集合。
由于内核也需要内存,因此会绘制一些任意线,这恰好位于 32 位 Windows 的 2GB 边界处,但也可以进行不同的配置。

它与计算机(虚拟或物理)上的内存量无关,但它是单个程序实例中可以使用多少内存的限制因素。然而,它并不是多个程序可以使用的内存的限制因素。

This is not about memory (physical or virtual), but about address space.

You can plug 16GB of physical memory into your computer and make a 100GB swapfile, but 32-bit (non-enterprise) Windows will still only see 4GB (and subtract 0.75 GB for GPU memory and such). Via PAE, it could use more, but non-enterprise versions won't do that.

On top of the actual amount of memory, there is address space, which is limited to 4GB as well. Basically it is no more and no less than the collection of "numbers" (which, in this case, are addresses) that can be represented by a 32 bit number.
Since the kernel will need memory too, there is some arbitrary line drawn, which happens to be at the 2GB boundary for 32bit Windows, but can be configured differently, too.

It has nothing to do with the amount of memory on your computer (virtual or phsyical), but it is a limiting factor of how much memory you can use within a single program instance. It is not, however, a limiting factor on the memory that several programs could use.

合久必婚 2024-10-25 01:55:51

据我所知,您所指的是什么限制可以分配多少内存。这与操作系统在运行时分配的内存量有很大不同。

As far as I can tell, what you are referring to are limits of how much memory can be allocated. This is much different than how much memory the OS allocated during runtime.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文