win服务器最大文件,Windows中有没有关于“最大文件打开数”的限制?

NT下,per process 的 handle count limit应该 只有32位和64位之分,文章里写道了

a handle entry is 8-bytes on 32-bit Windows and 12-bytes on 64-bit Windows.

The Executive allocates handle tables on demand in page-sized blocks that it divides into handle table entries. That means a page, which is 4096 bytes on both x86 and x64, can store 512 entries on 32-bit Windows and 256 entries on 64-bit Windows. The Executive

determines the maximum number of pages to allocate for handle entries by dividing the hard-coded maximum,16,777,216, by the number of handle entries in a page, which results on 32-bit Windows to 32,768 and on 64-bit Windows to 65,536. Because the Executive

uses the first entry of each page for its own tracking information, the number of handles available to a process is actually 16,777,216 minus those numbers, which explains the results obtained by Testlimit: 16,777,216-65,536 is

16,711,680 and 16,777,216-65,536-32,768 is 16,744,448.

但是,你要知道,这只是Handle的hardcoded Max count,实际你可能更本触及不到这个Limit,因为一般不会去创建(也由于内存限制,创建不出)这么多Kernel Object,也不会像TestLimit程序那样疯狂地DuplicateHandle去指向同一个Kernel Object。。。。。

------------------------------------------------------------------------------------------------------------

说到这里,貌似还需要补充另一半概念。

因为你问的“最大文件打开数”,我一开始把你指引到handle limit,是让你知道在一条河边钓鱼,最大可以有多少鱼竿(比作handle)同时钓,而没有说河里最多可以容纳多少条鱼(比作File Object)。。。

那么,河里可以有多少条鱼(File Object),你又得参见Mark Russinovich 的另一篇博文,得知道你能有多大的Non-Paged Pool

Nonpaged pool is therefore always kept present in physical memory and nonpaged pool virtual memory is assigned physical memory. Common system data structures stored in nonpaged pool include the kernel and objects that represent processes

and threads, synchronization objects like mutexes, semaphores and events, references to files, which are represented as file objects, and I/O request packets (IRPs), which represent I/O operations.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值