When running lots of applications, one may notice a moment where no more windows can be opened. This is the Desktop Heap limit; you will see this logged in the Event log as A desktop heap allocation failed

Back when I was running Windows Xp I hit this limit quite often (because of my working habits). The solution was to increase the limit; for this one needs to edit a specific registry key (always backup first!):

In Window Xp this is:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\SubSystems]

After setting the second (bold) value to 8192 I had never hit the limit again.

I haven’t reached this limit in Windows 7 x64 yet, but I’m writing down the defaults just to have them somewhere (as one can see, the limit in 64bit is quite a bit higher):