This happens to me at least 1-2 times per week. It’s actually not something that is specific to Internet Explorer 6.0, but is most frequent with this app due to the way I use it. The fact is, IE can be a resource hog depending on the websites you visit, especially GDI resources…
But there is a gotcha on Windows… The number of GDI resources that can be used at a time by a specific application are limited. The main reason behind this limitation is to prevent a stray or “leaky” application from hogging all system resources and bringing the whole system down with it. By default, at least in Windows XP, the maximum of GDI resources that can be held by a process is set to 10,000. Once the app reaches this limit, it will be unable to get more resources and will generally start rendering oddly (missing buttons, window content not updating, …) and then you generally have to kill the offending application and restart it…
Although not a fix, there is a way this can be minimized by increasing the maximum number of GDI resources that can be assigned to a process. The article quoted bellow (http://www.windows-now.com/blogs/kmkenney/archive/2007/08/29/increasing-gdi-and-user-handle-limits-in-windows.aspx) shows how you can increase the GDI resource limit from 10,000 to 16,384…
Have you ever been working with a good number of applications at once? Do you work with heavy workloads and large files every day? Alright, answer this – have you ever had Windows buckle under the weight of all of these applications and display error messages stating that the system is out of memory or out of resources, buttons and menus do not work correctly, or you get an error sound but no message on the screen? I’ve hit this numerous times, to the point that I’ve lost work because of it…
(By the way, Adobe, can you please implement that little feature that Microsoft Office has had for years known as “auto save”? I don’t know how many times I’ve managed to completely max out Windows designing a website and have had Photoshop fall over dead and disappear off my screen, only to find out that when I open Photoshop up again that the entire thing saved jack-all, all of those layers and documents gone poof into the void of darkness… if Microsoft can do it, why can’t you?)
Sometimes this happens even when you have a lot of system memory (RAM) still available. For instance, open up Internet Explorer and hold Ctrl+N to open up as many Internet Explorer windows as you can before menus, icons, and menus start displaying incorrectly, disappear, buttons aren’t clickable, etc. Close a few out and check your Windows Task Manager in the “Performance” tab; I bet you will find that a lot of your Physical Memory is still available.
This article applies to:
- Microsoft Windows 2000 family
- Microsoft Windows XP family
- Microsoft Windows Server 2003 family
- Microsoft Windows Vista family
This article does NOT apply to:
- Microsoft Windows XP Professional x64
- Microsoft Windows Server 2003 x64
- Microsoft Windows Vista x64
DISCLAIMER: I claim no responsibility or liability whatsoever should something go wrong, or if you incorrectly modify the Windows Registry. Please take extreme caution while following this publication and follow the steps correctly to a tee.
“Alright, if I have all of this memory still available, why is Windows saying I’m out of memory and out of system resources!?”
Simple: You have hit the “user handle” or “GDI handle” limit in Microsoft Windows. This limit is there for two reasons:
- Leaky applications or faulty code & malware can’t easily crash the system by attempting to overflow the system with GDI handles, making everything un-usable until a reboot is performed.
- To prevent a user from opening up more applications than the system can handle.
If you have 1 gigabyte (1024MB) of RAM or higher, the default User Handle and GDI Handle limits can be pretty restrictive when running a large working set of applications that demand the most from your system and tax it heavily.
First and foremost, I must warn you that modifying these settings incorrectly can render your Windows installation near useless. Also, depending on your computer configuration and the amount of RAM in your system, you may wish to play around with the numbers until you find a setting that is perfect for your computer configuration and working set.
To back up everything, open the Windows Registry Editor:
- Click on the Start button.
- On the Start menu, click on “Run…”
- In the Run dialog, type “regedit.exe” (without the quotes) and then press Enter or click OK.
Now, to backup a registry key:
In the Registry Editor on the left hand side, you will see the navigation pane. Using your mouse or keyboard, navigate to the following subkeys:
Right click on each of the subkeys above in the left hand pane and from the context menu that appears, choose the “Export” option. Save the exported registry data files where ever you wish, but make sure that they will be accessible should we need to restore them in the future.
Now that you have backed up the registry keys that we will be modifying, we can begin making modifications to the values in order to increase the handle limits in Windows.
With the Registry Editor opened, navigate to HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\SubSystems.
You will notice a set of “REG_MULTI_SZ” and “REG_EXPAND_SZ” keys in the right hand pane. The one that we are interested in modifying is called “Windows”.
To modify the key, double click on it. It should look something like this:
%SystemRoot%\system32\csrss.exe ObjectDirectory=\Windows SharedSection=1024,3072,512 Windows=On SubSystemType=Windows ServerDll=basesrv,1 ServerDll=winsrv:UserServerDllInitialization,3 ServerDll=winsrv:ConServerDllInitialization,2 ProfileControl=Off MaxRequestThreads=16
The section of this string we are interested in modifying is SharedSection.
In the SharedSection part of the string you will notice 3 numbers. What we are interested in is the middle value, “3072”. Modify this value so that it reads “8192” instead.
It should look something like this after modifying the value:
%SystemRoot%\system32\csrss.exe ObjectDirectory=\Windows SharedSection=1024,8192,512 Windows=On SubSystemType=Windows ServerDll=basesrv,1 ServerDll=winsrv:UserServerDllInitialization,3 ServerDll=winsrv:ConServerDllInitialization,2 ProfileControl=Off MaxRequestThreads=16
Now that this registry entry has been modified we can continue on with the other values that need to be modified in order to raise the GDI limits.
In the left hand pane of the Registry Editor, navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows. In the right hand side, you will see two REG_DWORD values, named GDIProcessHandleQuota and USERProcessHandleQuota. We will need to modify both of these.
The first key we will want to modify is GDIProcessHandleQuota. This keys value can be set between 256 and 16,384 (maximum), and the default value is 10,000. I’d recommend using 15,000 as a value for this key, however if you are doing a lot of multitasking, shoot for the stars and go with 16,384.
This key cannot be set past 16,384 as it is the maximum acceptable value.
Now, let’s modify USERProcessHandleQuota. This keys value can be set between 200 and 18,000 (maximum), with a default value of 10,000. I’d recommend increasing this value to the same number used with GDIProcessHandleQuota, however as previously mentioned if you are working with a hefty application workload, shoot for the stars and go with the maximum value of 18,000.
This key cannot be set past 18,000 as it is the maximum acceptable value.
Do NOT attempt to increase these values past the maximum – Windows will become very unstable and may even stop working correctly. If Windows starts acting up after changing these values, lower them until the issues are resolved, or restore the backups of these keys’ values that we created before making modifications.
Now that you’ve changed these values, restart your computer and tax the system using the Internet Explorer trick mentioned previously – open Internet Explorer and hold down Ctrl+N on your keyboard to open up new Internet Explorer windows. Continue this until menus, buttons, and user interface elements stop working correctly. Also, open any applications you run day-to-day while you are performing this, so that you can get more of an idea if you have everything configured correctly.
You may also want to monitor your memory usage and handles information in Task Manager to see whether or not the above registry values need any more modifications.