narrow default width wide
colour style colour style colour style colour style

Fixed an annoying problem with running out of GDI Objects

I've had a problem with my desktop for a while now..It appeared that I was running out of resources and I kept having to close apps down in order to open up new windows or access menu items. This was happening even though I still had tons of free available memory. I tried running some memory cleanup tools, changing my pagefile settings (smaller/bigger, fixed size/let windows handle it, etc). Unfortunately, nothing fixed my problem. As a side note, I've run into this before occasionally but lately it has been horrible. It really seemed to get worse when I installed IE7 although I did have the issue a few times when I used FireFox.

Anyway, today I was trying to help someone out with a scripting issue and I kept having to close the windows I needed open. I was finally fed up. I needed to fix this problem or rebuild my system.

Thankfully, I think I found the fix. It has to do with running out of 'GDI Objects'. I opened up Task Manager and added the column so I could view GDI Objects and was not surprised at all to see the my IE processes were using up more than anything else. I usually keep 3-4 separate IE processes running and have 3-5 tabs open in each of them. Now, I don't really care that IE is using them..I just want to run my freaking applications. (Here's a link to someone more knowledgable than I complaining about IE7's usage of GDI objects though). It's a shame to have all of this memory if Windows only puts a small amount of it into a critical area. Thankfully there is a hotfix and a reghack to help with the problem. The hotfix is just to help with a specific problem with Themes in Windows. I went ahead and installed it but that doesn't really fix my problem. I need to increase the amount of memory available for these troublesome GDI Objects.

The reghack details how to go about changing the settings. It affects more than just GDI Objects, it affects the "Desktop Heap". I don't know exactly what that is nor do I care at the moment.

Anyway, I ended up changing my settings from:

Windows SharedSection=1024,3072,512


Windows SharedSection=1024,8192,2048

I went ahead and opened up 5 separate IE processes with 7-8 tabs each, MOM admin, MOM operator, ADSIEdit, AD MMC, GPMC, PrimalScript, Lotus Notes, etc and I am running without any problems at all.

My question is this, what's the point of having all of this RAM if you still can't open up all of the stuff you want to? Maybe Microsoft needs to re-think the default settings for that registry entry now that people have more RAM in their systems. Or at least give you an easier way to change it like they've done with the 'performance' options that you can choose from in a number of Control Panel applets.

EDIT: I couldn't be happier! I can open up as much as I want to now! Also, I was just explaining my joy at fixing this problem to a co-worker and he mentioned that a new clinical application that my current client is starting to implement seems to eat up GDI resources as well. The problem is so bad that they install a special GDI Object monitor to let you know when you are close to running out of them. Once again, I ask the question, why not just increase how many are available?!?!?  Maybe there is a downside to the reg changes I made...I guess I'll find out eventually if there is. Unfortunately, there are a ton of web sites that talk about monitoring GDI objects and how to prevent leaks but there doesn't seem to be a lot of information on making a change like the one that I did.

EDIT #2 - I found a nice article that describes it a lot better. I just had to start searching for "Desktop Heap" instead of "GDI Objects" and I found some pretty good resources. There is a link to a good forum thread at the end of the 3rd page of the article discussing this issue a bit further as well. Apparently there shouldn't be any real negative affects to my change. Apparently you can adjust the total size of the Desktop Heap from the default of 48 MB using the following reg value:

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

I have no need to mess with that since I just care about my XP desktop but it is handy information to know in case I run into anything like this again.