GDI Limits
Tuesday, 04 September 2007 by Michel Roth
Those who have been around in Terminal Server or Citrix environments long enough will have noticed that there are a couple of bottlenecks that exist that are often ill understood. One of these is the rather cool sounding "GDI Limit".

GDI objects are a class of resources that help shape the Windows Operating system graphically. They facilitate the resources responsible for creating for dialog boxes, icons, menu items and so on. You could say that GDI objects are what make Windows Windows.

If you are not a particularly heavy user of Windows you will probably never reach the limit of Windows in terms of GDI limits. However, a Terminal or Citrix server under a heavy load by lots of users could reach that GDI limit. This depletion of GDI handles can be caused by a faulty application that is "leaking" GDI handles or a user that is demanding a lot of GDI resources from the system.

How can you tell if you have reached Windows' GDI limit? Well, it kind of looks like Windows is drunk ..... message boxes are empty, buttons are not click-able or parts of some application windows are just plain missing. It's quite easy to monitor the ammount of GDI objects a particular program has in use by just using good ol' task manager. Just add the column for "GDI Objects":



If there's a process in there that keep claiming more and more GDI Objects without ever stopping, chances are you have a "leaker". If you find that indeed have depleted all the GDI objects available to you and you have determined that this is not being causes by a GDI handle leak, you could try and tune the GDI limit, in other words make it less restrictive.

Remember that GDI handles are not in place for nothing. GDI handles are a kernel memory paged pool resource and when you run out of paged pool memory you are in a very unhappy place. So you can tune the GDI limits but be very careful about it.

Kristan Kenny has an excellent article up on how you can tune the GDI limits in Windows (Server 2003). Microsoft also has a particularly handy KB article that helps you tune GDI limits as well: KB840342.

Related Items:

One reason Why Windows Server 2008 Terminal Server Will Allow You To Get More Users On A Box (10 February 2008)
Windows System Resource Manager (12 February 2005)
Lanmanserver and Lanmanworkstation Tuning (20 February 2007)
What's going On With My Pagefile ... And The Rest Of My Server? (15 May 2007)
Multi-monitor support For Citrix ICA Sessions (13 April 2006)
What to Expect From the Windows Terminal Services in a 64-Bit Environment (16 April 2006)
TechNet Webcast: Next Generation Command Line Scripting with Monad (Part 1 of 2) (Level 300) (13 July 2005)
AppSense Management Suite 6.1 (24 January 2006)
Making Softgrid's Bubble Burst (21 September 2007)
Sysinternals Handle Updated To Version 3.0 (10 March 2005)
Comments (0)