Maximum Number of Open Windows under Windows?
Triones asks: "I have found that Windows 2000 has a limit on the number of
distinct windows that can be opened. W2K cannot open more
than around 70 distinct windows (duplicate IE's on the same
url don't count) even when it has 50Mb free phyiscal
memory and much more in system cache. The max I can get is
about 75 windows. Similar limits on machines with
256Mb or 512Mb ram. Some of my friends have reproduced this
phenomenon on their systems. (By the way, no such problem with Linux (Redhat,
XFree86, Gnome, Sawfish)). Is it related to the graphics
'resource' (GDI?) in Windows? Is there a parameter that can be
tuned to increase the limit? If this is a 'flaw', is it fixed in XP?"
IE uses about 10 MB of "memory" (swap or physical) per instance. You're right that duplicate URIs don't count; it probably has something to do about it is just displaying the same instance twice, not actually spawning a new one.
Office 2000 apps require in the range of 40MB of free memory. SCSIFiberPro 32 uses about 2MB. Winamp, Morpheus, etc. use 5-10 each.
That's not that much, however. What's really draining your memory is probably the services you're running.
LSASS uses only 1MB, so thats not a big deal, but SVCHOST uses 8-10, services.exe uses 10-ish, most of the others are in the 5-10 range, but there's about a dozen of them. With nothing running except for the services, I use 90MB of physical memory; it's about 105 when using IEXPLORE on top of that.
Windows doesn't have the best resource mangment available. However, Win 2K has considerably better than Windows 9x does - you'd crash long before you opened 70 some windows in one of those OSes.
(All numbers taken from the processes tab of Task Manager.)
JKoebel
Disclaimer: I write drivers for Windows 2000 and Windows.NET (I did not name it). The following does not apply to Windows 9x (including Me).
The long answer is that the limit is dependant on the amount of memory in your system as well as a number of other factors.
The first factor is the amount of memory. This includes RAM and the page file. The second factor is the size of the each process running on the system. If you are openning a new process for each "window" (it was not clear from the description) then the amount of memory consumed is much higher than the amount of memory consumed by each new window in the same process. The third factor, and this is the big one, is the size of the file system cache. Windows dynamically decides how much memory should be devoted to file system cache at boot time and that limits the amount of memory available for everything else in the system (including other components of the operating system). The formula that Windows used to determine the optimal size of the file system cache takes into account many factors.
When available memory begins to run low then new processes may not be able to start and new windows may not be able to be created.
(correct email: miket@NOSPAM.telocity.com w/o the NOSPAM)
Imagination is more important than knowledge. --Albert Einstein
-- ;-)
Kuro5hin.org: where the good times never end.
There is a form of limit in Windows that affects the NT family of systems - usually referred to as the "desktop heap". Hitting the limit is manifested as either a DLL initilization error for USER32.dll or an out of memory error. Fortunately, the limit it tweakable (after NT 4 Service Pack 2 at least), but the default settings are low enough that the limit is easily hit.
To tweak the limit, take a look in the registry at HLKM/System/CurrentControlSet/Control/Session Manager/SubSystems - there is a key called "Windows" that contains (among other things) "SharedSection=1024,3072". Changing the SharedSection entry to "1024,3072,512" increases the size of the "hidden" desktop heap. If that doesn't work, try increasing the second of the comma delimited values (e.g. 3072 -> 4096), which is the size limit of any particular desktop heap.
I'm not sure if this is the limit the poster of this Ask Slashdot is hitting, but I do know that we have problems with this particular limit at work. We run an interpreted language/database/remote development environment, including customer applications as Windows Services. After stopping and starting the service multiple times, we get a USER32.DLL error for one or more of the executables running under that service - the only resolution is to reboot the machine, even after applying the aforementioned registry tweaks.
Maybe I'm missing the point, but would even a hard-coded max of 70 actually limit anyone's use of Windows in any meaningful sense?
An example of how this limitation would affect anybody would be interesting.