保留和提交的内存有什么区别? [英] What's the difference between reserved and committed memory?

查看:105
本文介绍了保留和提交的内存有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我了解必须在提交内存之前保留内存.并且当保留它时,没有其他进程可以使用它.但是,保留的内存不计入可用的RAM.但是不是吗?因为如果没有人可以使用它,那么可用"有什么好处?

I understand that memory has to be reserved before being committed. And when it's reserved, no other process can use it. However reserved memory does not count against available RAM. But shouldn't it? Because if no one else can use it, then what good is it being "available"?

还是有更大的区别?

推荐答案

在Win32的上下文中,保留"表示在请求过程中在中分配了地址空间.例如,这可以用来为不是立即需要的大缓冲区保留空间,但是当需要它时,它必须是连续的.

In the context of Win32, "reserved" means that the address space is allocated within the process that requested it. This may be used, for example, to reserve space for a large buffer that's not all needed right away, but when it's needed it would need to be contiguous.

保留内存根本不与其他进程交互,因为每个进程都有自己的专用地址空间.因此,保留时,没有其他进程可以使用它"这一说法毫无意义,因为进程通常无论如何都无法在另一个进程的地址空间中分配内存.

Reserving memory does not interact with other processes at all, since each process has its own private address space. So the statement that "when it's reserved, no other process can use it" is meaningless, since processes can't normally allocate memory in the address space of another process anyway.

当请求提交保留的页面(为其分配的后备存储)时,由于缺少物理内存(或页面文件),该操作可能会失败.

When the reserved pages are requested to be committed (backing store allocated for them), that operation can potentially fail due to lack of physical memory (or pagefile).

这篇关于保留和提交的内存有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆