gpt4 book ai didi

c# - Windows 上任何单个进程可以处理的最大内存量

转载 作者:IT王子 更新时间:2023-10-28 23:29:00 25 4
gpt4 key购买 nike

Memory Limits for Windows Releases回答 Windows 上任何单个进程可以处理的最大内存量是多少:

On 32-bit versions of Windows, a single process can map and address nomore than 3GB of virtual memory at time. In 64-bit versions ofWindows, a 32-bit process can map and address no more than 4GB ofvirtual memory at a time.

For 64-bit processes, the amount is difficult to calculate as thereare numerous overlapping limits that could apply depending on allkinds of factors. It's typically around 7TB.

我的问题:如何验证“3GB”、“4GB”等值?

可以编写一个 C# 程序来证明它吗?有办法吗?

最佳答案

Mark Russinovich 发表了一个关于 windows 内存资源的多部分系列,确实很好地涵盖了这一点。你可以在这里找到它: http://blogs.technet.com/b/markrussinovich/archive/2008/07/21/3092070.aspx

他介绍了限制的原因以及测试。测试代码在某处的 pipe 里飘来飘去。

如果您想了解内存资源以及从泄漏各种类型中可以看到的问题,这是一本不错的书。

但是,简而言之,32 位操作系统上的 32 位:2 GB,除非设置为大地址空间感知,在这种情况下为 3 GB。 64 位操作系统上的 32 位:2 GB,除非设置为大地址空间感知,在这种情况下为 4 GB。

64 位进程:2 GB,除非设置为大地址空间感知,在这种情况下,它可以寻址高达 8 TB,除非它托管在限制为 7 TB 的基于 Intel Itanium 的系统上。

Microsoft 在以下位置说明了各种限制(按风格和类型): http://msdn.microsoft.com/en-us/library/aa366778.aspx

关于c# - Windows 上任何单个进程可以处理的最大内存量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11891593/

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