Slashdot Mirror


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?"

5 of 34 comments (clear)

  1. The cat got my tongue! by Anonymous Coward · · Score: 1, Informative

    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...

  2. Short answer: No hard limit in the OS. by miket · · Score: 4, Informative

    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
    1. Re:Short answer: No hard limit in the OS. by man_ls · · Score: 3, Informative

      Windows 2000 has a variable page file size, but it doesn't adjust very gracefully at all. I've run into the limit before I upgraded to 384MB of physical RAM; before that time, opening Everquest with Winamp running hit the page file barrier. It popped up a message saying that it was out of available space, and was increasing the page file size, but more often than not, the system would either bluescreen with an HIRQ_EXCEPTION_NOT_HANDLED error, or just become unresponsive.

      Other than that, Win2K has the best memory managment that I've seen on a Windows OS.

      JKoebel

  3. linux virtual terminals/console by Siva · · Score: 2, Informative

    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.

    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 /devices.txt and console(4) for more info...

    --Siva

    --

    Keyboard not found.
    Press F1 to continue.
  4. Desktop heap size by mjg · · Score: 4, Informative

    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.