Windows 7 中一个进程的 GDI 对象上限是多少? [英] What's the upper limit on GDI objects for one process in Windows 7?
问题描述
有一个 GDI 泄漏的应用程序最终会达到 10,000 个已分配的 GDI 对象并崩溃.我尝试增加 GDIProcessHandleQuota 到 20,000,但程序在达到 10,000 个对象时仍然崩溃.我们目前正在修复这个漏洞,但出于好奇——有没有办法增加单个进程的 GDI 限制?还是 10k 是单个应用程序的硬限制?
Have an application with a GDI leak that will eventually hit 10,000 allocated GDI objects and crash. I tried increasing the GDIProcessHandleQuota to 20,000, but the program still crashed when it reached 10,000 objects. We're currently working on patching this leak, but out of curiosity--is there a way to increase the GDI limit for a single process? Or is 10k an individual application's hard limit?
推荐答案
有一个可行的解决方案.我在这里处理一个行为不端的供应商应用程序,它分配了大量的 GDI 对象,这个解决方案允许它在大多数时间工作......
There is a solution that might work. I deal with a misbehaved vendor's app here that allocates tons of GDI objects and this solution allows it to work most of the time...
做
reg query "HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSession ManagerSubSystems"/v windows
查找 SharedSection=
应该是 3 个用逗号分隔的数字.一次将中间数增加 1024,看看是否能解决您的问题.您正在使用此变量控制桌面堆"的数量,这在过去允许我运行行为不端的 GDI.
Look for SharedSection=
which should be 3 numbers separated by commas. Increase the middle number by 1024 at a time and see if that solves your problem. You are controlling the amount of "desktop heap" with this variable which has in the past allowed me to get a misbehaving GDI running.
查看 KB184802 了解更多信息.搜索 SharedSection 以找到页面的相关部分.
Look at KB184802 for a little more info. Search for SharedSection to find the relevant part of the page.
这篇关于Windows 7 中一个进程的 GDI 对象上限是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!