Windows系统极限-程序可使用资源的限制

来源:互联网 发布:网络开发包括哪些 编辑:程序博客网 时间:2024/05/16 07:47

最近,收到的log消息显示:XP系统的限制明显比WIN7多。很多在WIN7下没有问题的程序在XP下报错了。于是就有了下文......


1. WriteFile. Windows Server 2003 and Windows XP:  Pipe write operations across a network are limited in size per write. The amount varies per platform. For x86 platforms it's 63.97 MB. For x64 platforms it's 31.97 MB. For Itanium it's 63.95 MB. For more information regarding pipes, see the Remarks section.

x86 (32-bit) 4096 4 bytes ((65535 - 28) / 4) * 4096 = 67076096 bytes (63.97 MB)
IA64 8096 8 bytes ((65535 - 48) / 8) * 8192 = 67051520 bytes (63.95 MB)
X64 4096 8 bytes ((65535 - 48) / 8) * 4096 = 33525760 bytes (32MB - 28K)

2. HANDLE. The total number of open handles in the system is limited only by the amount of memory available. Some object types support a limited number of handles per session or per process. 
More files are open than the memory cache manager can handle. As a result, the cache manager has exhausted the available paged pool memory.
貌似XP是10000,Win7依赖内存大小一致。一般是打开句柄没关,句柄泄漏会有问题。Windows的每一个句柄都是要占用内存的。

前两个问题一般可以修改这两个参数。HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management     a. PoolUsageMaximum b. PagedPoolSize

3. Memory. 貌似XP一个process 只能使用 1G的内存。 内存别看还有100多M,但内存块可以全是碎小的,很有可能不能分配1M的空间。

4. CPU没有上限,但是一般到80%以上,就会出现用户卡界面的情况。

5. Socket. 数量在注册表里可以修改限制。XP使用的是默认值(貌似是:1024 - 5000),WIN7使用的是最大值(1024 - 65534)。

6. file size. windows只有NTFS格式的硬盘才支持单个文件大于4G。

7. 此外,发现XP系统中对磁盘操作,很容易损坏文件。PS: http://msdn.microsoft.com/en-us/library/windows/desktop/aa365738(v=vs.85).aspx

8. 嵌套栈空间。递归层数极限在2500左右。win7下嵌套栈超过1024K栈溢出。

9. 桌面堆空间。http://blogs.msdn.com/b/ntdebugging/archive/2007/01/04/desktop-heap-overview.aspx

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management

OS

Size if no registry value configured

Default registry value

Windows 2000 *

20 MB

none

Windows XP

20 MB

48 MB

Windows Server 2003

20 MB

48 MB



0 0
原创粉丝点击