5

Searching the web and not finding a sufficient answer I have to ask again: Is there any way to increase the maximum amount of GDI Objects for Windows 10?

The application i'm using is written in VB6 with some third party controls (leaks from the controls are possible) and it uses a lot of child windows for displaying data across the app.

Edit: The Application itself is designed to create multiple intances of very large user controls. Each control contains a heavily modified third party grid, toolbars and windows forms. The forms themselves can open different user controls (with grids, toolbars and forms) and so on. Therefore large numbers of handles are created. We always hunt for leaks and fix them immediately but unfortunately not everything is a leak but a side effect of the application design (which was made before my time).

I tried several things, from increasing the registry values under

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows\GDIProcessHandleQuota]

[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows NT\CurrentVersion\Windows\GDIProcessHandleQuota]

to increasing the desktop heap but nothing takes effect. Even after a restart the limit is still 10000 handles.

It seems like there is a static value somewhere hidden inside windows or the registry which overwrites the value because even lowering the value does not affect the limit of 10000 handles.

Thanks in advance!

Stefan Hinkel
  • 81
  • 1
  • 1
  • 4
  • 1
    [this may be helpful](http://stackoverflow.com/questions/9723470/whats-the-upper-limit-on-gdi-objects-for-one-process-in-windows-7) Could you post your code involved also? There may be a way to limit the handles if it's creating too many. – Jimmy Smith Jul 27 '16 at 14:56
  • Thanks for the reply. I've already found that article. I've also read the links posted there but it was not helpful. Changing the registry works up to Windows 8.1. Only Windows 10 causes problems because, like i said above it seems like it is not accepting the changed value like the other Windows versions before. Posting affected code is a problem because the whole application is a affected but I will add a more detailed description of out application in the question. – Stefan Hinkel Jul 28 '16 at 05:55
  • 1
    I did a little reading, and I found a reference to the desktop heap. [Test this solution out](https://social.msdn.microsoft.com/Forums/sqlserver/en-US/c4fd65cc-2b87-4478-9997-828071220fcd/windows-10-gdi-objects-limit?forum=windowscompatibility) and that leads you to [this kb page](https://support.microsoft.com/en-us/kb/184802) – Jimmy Smith Jul 28 '16 at 13:37
  • I tried increaing the desktop heap (mentioned that in my original question) but it is not working for me. The 10000 GDI Objects Limit is still present. – Stefan Hinkel Aug 01 '16 at 14:28
  • Everything I've looked at I am coming up blank. This seems to be throttled. What is this 3rd party control that's leaking them so badly? There may be some workarounds. – Jimmy Smith Aug 01 '16 at 15:08
  • Sorry for the late response. Busy times the last two weeks. We are using VideoSoft VSFlexGrid Pro 7.0 and DataDynamics Active Bar 2.0 and 3.0 with the latest patches but I don't thinks that there is a possibility to optimize the usage. The large number of handles are created because of the applications design (see question). And like I said, we are always hunting for possible leaks. – Stefan Hinkel Aug 16 '16 at 08:52
  • It's been a long time since posting this question but, and thats good news i think, the problem has been solved by MS themselves. According to a colleague there have been some fixes to the Windows GDI Handling in a December KB article. (KB 3204066 I think). Since then the registry keys are used like before. – Stefan Hinkel Mar 21 '17 at 12:37
  • @StefanHinkel So it's not fixed, but you could increase the limit? I am also facing issues with FlexGrid with lots of rows, hitting 9999 GDI object, then App is unusable. – Zoli May 29 '18 at 15:31

2 Answers2

5

You are able to change the limit on current versions of Windows 10 (tested on 1803, 1809, 1903, 1909 and 2004)

For GDI handles change this Registry Key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows\GDIProcessHandleQuota

Range: 256 - 65,536. Default value: 10000

For USER handles change this Registry Key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows\USERProcessHandleQuota

Range: 200 - 18,000. Default value: 10000


Remember to reboot for the changes to take effect.

Henrik Høyer
  • 1,225
  • 1
  • 19
  • 27
2

You have to reboot Windows 10 for this registry setting to take effect. Also be aware that on x64 there are two GDIProcessHandleQuota values in the registry.

adigostin
  • 633
  • 7
  • 20