gpt4 book ai didi

memory - MEM_RESERVE 和 MEM_COMMIT 状态之间的确切区别是什么?

转载 作者:IT王子 更新时间:2023-10-28 23:31:47 27 4
gpt4 key购买 nike

据我了解,MEM_RESERVE 实际上是“空闲”内存,即可供我的进程使用,但尚未分配?或者它以前被分配,但后来被释放了?

具体来说,在下面的 !address 输出中查看我几乎没有虚拟地址空间(99900 KB 可用,2307872 为 MEM_PRIVATE。但状态显示其中 44.75% 实际上是 MEM_RESERVE。这是否意味着它实际上是免费的,在我的过程中......但可能是零散的?

0:000> !address -summary
--------- PEB a8bd8000 not found ----

-------------------- Usage SUMMARY --------------------------
TotSize ( KB) Pct(Tots) Pct(Busy) Usage
259af000 ( 616124) : 22.29% 23.12% : RegionUsageIsVAD
618f000 ( 99900) : 03.61% 00.00% : RegionUsageFree
13e22000 ( 325768) : 11.78% 12.22% : RegionUsageImage
42c04000 ( 1093648) : 39.56% 41.04% : RegionUsageStack
42d000 ( 4276) : 00.15% 00.16% : RegionUsageTeb
2625d000 ( 625012) : 22.61% 23.45% : RegionUsageHeap
0 ( 0) : 00.00% 00.00% : RegionUsagePageHeap
0 ( 0) : 00.00% 00.00% : RegionUsagePeb
1000 ( 4) : 00.00% 00.00% : RegionUsageProcessParametrs
1000 ( 4) : 00.00% 00.00% : RegionUsageEnvironmentBlock
Tot: a8bf0000 (2764736 KB) Busy: a2a61000 (2664836 KB)

-------------------- Type SUMMARY --------------------------
TotSize ( KB) Pct(Tots) Usage
618f000 ( 99900) : 03.61% : <free>
13e22000 ( 325768) : 11.78% : MEM_IMAGE
1e77000 ( 31196) : 01.13% : MEM_MAPPED
8cdc8000 ( 2307872) : 83.48% : MEM_PRIVATE

-------------------- State SUMMARY --------------------------
TotSize ( KB) Pct(Tots) Usage
57235000 ( 1427668) : 51.64% : MEM_COMMIT
618f000 ( 99900) : 03.61% : MEM_FREE
4b82c000 ( 1237168) : 44.75% : MEM_RESERVE

Largest free region: Base 7e4a1000 - Size 000ff000 (1020 KB)

跟进:

因此,就我的示例而言,此过程报告“内存不足”,但实际上它可以进行分配,但有人 MEM_RESERVED 超出了他们当时的需要,从而阻止其他人甚至无法分配?

最佳答案

MEM_RESERVE 由进程分配。 IE。地址空间被认为正在使用中。然而,它并没有被 promise 。要实际使用内存进行存储,它必须被提交。马克 Russinovich 拥有 an excellent post ,它描述了所有细节。来自帖子

Testlimit’s –r switch has it reserve virtual memory, but not actually commit it. Reserved virtual memory can’t actually store data or code, but applications sometimes use a reservation to create a large block of virtual memory and then commit it as needed to ensure that the committed memory is contiguous in the address space. When a process commits a region of virtual memory, the operating system guarantees that it can maintain all the data the process stores in the memory either in physical memory or on disk. That means that a process can run up against another limit: the commit limit.

关于memory - MEM_RESERVE 和 MEM_COMMIT 状态之间的确切区别是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2546283/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com