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?"
I don't think its a flaw, but its not a feature either. Probably what happens is that it just runs out of resources, and can't open any more windows.
Linux just has better resource managment, but I'm sure it has its limit aswell.
OK, I just opened 90 Notepads. Only 128MB RAM, on Windows 98SE. I guess Notepad isn't IE.
Also, on linux, I was under the impression that the virtual terminals *were* limited - when you compile a kernel the default is 256 ptys; I may just be utterly wrong here, but I thought that meant there was a 256 virtual terminal limit. I would presume it also applies to X - but does X open all of it's stuff in a single console terminal?
Acting stupid isn't much fun when there's someone around who knows better
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
Win2k doesn't really have a limit to window handles. Using a foreverlooping .bat-file I opened about 500 notepad windows before hitting the page file (512MB RAM). It all depends on how much memory you've got...
Internally, windows is not smart enough to distigush between a top-level windows and a control. Therefore, I can say with some certainity, that there is no built in limit on top-level windows. So far, everyone is mentioning resource constraints and I'd have to agree with this.
int func(int a);
func((b += 3, b));
this way if you need more open windows you can get the enterprise server edition and spend an extra bunch of cash. ..'userfriendly'.
BTW what the hell do you need to open that many windows for? you don't even have grouping on your taskbar or the ability to create several workspaces/desktops and ALT-arrow between them like we do under Linux/Gnome. I can see your taskbar with each pixel representing a window must be real
"The Most Fun Possible on 4 wheels" is at SunBuggy in Las Vegas
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
first of all, the newer linux kernels support both BSD and Unix98 style pseudo-terminals. both can coexist on the same system. redhat 6.2 for example uses BSD style for text virtual consoles (/dev/tty1 - /dev/tty6 by default), and Unix98 style (/dev/pts/0 - /dev/pts/255) for X-based terminals and remote terminals.
/devices.txt and console(4) for more info...
also, native X-Windows programs (excluding things like xterm and rxvt) do not usually open pseudo-terminals for themselves (you can see this using lsof or even ps). i think they utilize some feature of the X-Windows protocol to have the X server send messages to the console on their behalf (never done any X programming so not sure how that works). so while there may be a software-imposed limit to the number of xterms i could open, there isnt one for the number of games of xbill i could open.
mmm....hundreds of millions of dead Bill's...
see
--Siva
Keyboard not found.
Press F1 to continue.
I think you answered your own question, except it's not so much related to GDI limits as it is GDI limits. I'm not up on the topic myself, but I'm sure there are many excellent resources to be found with a simple Google search.
75 windows ought to be enough for anyone. :-)
Who needs that many windows?
The man who trades freedom for security does not deserve nor will he ever receive either. - Benjamin Franklin
...but remember, this is a limitation that Linux doesn't have, so it goes up on Slashdot, HEY WINDOWS 5UX0RS BECAUSE IT CAN'T OPEN 400 WINDOWS LIKE LINUX CAN!!!!
Useless, but hey, these maniacs are grasping at anything they can.
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.
While obviously if your short on memory you can't open very many windows. But in MS Windows, everything is given a GDI number. Its kind of like a pointer, but more crappy. It was a way for them to save memory in the Windows 3.1 days. In Windows 9x the number of GDI's were tripled, and they should be increased more in XP (each program gets as many GDIs as all of Windows 9x IIRC). However, I do not think there is an improvement from Windows 2000.
We've ALL (yes you have, c'mon, admit it) been to those pr0n sites that open more browser windows than you can handle, and ever time you close one, it opens three more.
Back when I only had 64MB ram, win98SE would choke and die at about 35 windows of netscape...
Now with 512MB it can handle about 60 or so...Can't really count then because as someone said before, each task in the task bar is only about a pixel wide.
I wish my wife would get up the gumption to learn X/KDE so I can clean this virus off my computer and stop dual booting....
I remember demos opening 1,000 windows testing a system out.
Once I had a folder with ~ 250 ZIP files, and instead of hitting COPY I hit EXTRACT with WINZIP. About 10 minutes later I had 250 WinZip's open.
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.
Every native control in Windows has its own window handle. There's a zillion window handles available, and this lets you do some pretty funky things if you want to have some fun coding. For that reason, I wouldn't call it stupidity- it's just by design. (It's not a bug, it's a feature! Stop complaining or we'll charge you extra for it.)