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

34 comments

  1. Hmm... by Beowulf_Boy · · Score: 1

    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.

  2. 90 for me by Red+Moose · · Score: 2, Insightful
    I know that each instance of IE needs around 10-15 MB, and bad resource management like that - stealing RAM and swap for each app instance no matter what it's used for - contributes.

    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

    1. Re:90 for me by sigwinch · · Score: 4, Interesting
      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.
      True, although 256 ptys is probably more than enough for any single-user system. If you need more you can build a kernel that supports (IIRC) 2048 ptys.
      I would presume it also applies to X - but does X open all of it's stuff in a single console terminal?
      Ptys look like a serial port to the downstream process, but upstream is another process instead of serial port hardware. Thus they're only used for things like terminal emulators that really need serial port compatibility. Most X programs don't use them.
      --

      --
      Kuro5hin.org: where the good times never end. ;-)

    2. Re:90 for me by karlbowden · · Score: 1

      I can only open 250 notepads on winXP, with 256mb ram. But I can also close them all with two clicks, (task grouping). I can only open 80 gedits in redhat 7.1 before it starts swap disking.

  3. Resource limitations by man_ls · · Score: 4, Interesting

    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

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

  5. Windows is too stupid to have such a limit by lkaos · · Score: 1

    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));
  6. it's a feature by BroadbandBradley · · Score: 2

    this way if you need more open windows you can get the enterprise server edition and spend an extra bunch of cash.
    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 ..'userfriendly'.

    1. Re:it's a feature by BroadbandBradley · · Score: 2

      I meant CTRL-ALT-Arrow, not Alt-Arrow.

    2. Re:it's a feature by Hall · · Score: 1

      Matrox video drivers come with something called 'Quick Desk' that allows multiple desktops. I use it with NT4 at work... The keystroke for switching between them is configurable. The taskbar only shows the windows on the desktop you're on too.

    3. Re:it's a feature by Siva · · Score: 2, Funny

      BTW what the hell do you need to open that many windows for?

      for porn, silly :P

      --Siva

      --

      Keyboard not found.
      Press F1 to continue.
    4. Re:it's a feature by Anonymous Coward · · Score: 0

      Multiple desktops are a built-in feature of NT. I am not sure, they may have been available as far back as 3.x. You could do it with the resource kit in 4.x. Of course, in Typical Microsoft Fashion, the implementation is left up to some third party app writer until that feature becomes the next "killer app," (e.g., Citrix Winframe) at which point MS buys up everyone else who's writing for that feature and runs 'em out of business. Time slicing, disk quotas, and multiple desktops are all features that have been available but not natively implemented in NT for years and years and years. Let's face it, they're too dumb to really take over the world with innovation. They merely wait around for someone else to lead, at which point they pounce and follow . . .

    5. Re:it's a feature by hwolfe · · Score: 1

      Multiple desktops have been available since 3.x. Central Point had a shell replacement that set up 3 desktops. Litestep, and I'm sure other replacement shells for explorer, have vwm's available.

      I currently have 4 desktops under litestep, which is plenty for me. The docs for the vwm don't appear to give a limit to the size, but I would think anything bigger than 3x3 or 4x4 is impractical.

    6. Re:it's a feature by The+Real+Andrew · · Score: 1

      I use a great little tool called JSPager to give me multiple desktops under Win2000.

      http://hem.fyristorg.com/jspage/

      Andrew

    7. Re:it's a feature by WarForge · · Score: 1

      I have grouping on MY windows taskbar AND the ability to create several desktops with a nice utility called JSPager. Taskbar grouping is one of the reasons I switched to XP.

      Now the big question becomes "What to do with all these open prOn sites? ;-P "

    8. Re:it's a feature by thaigan · · Score: 1

      ...what the hell do you need to open that many windows for...


      I've seen a performance testing suite that simulated multiple simultaneous users to test remote cgis. It opened a window for every user and would probably run into trouble if it was being used to do stress testing.

      --

      42
  7. 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 Anonymous Coward · · Score: 0

      Wait, you're telling me that w2k uses a fixed size page cache? That's unbelievable!

    2. 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. Re:Short answer: No hard limit in the OS. by ers81239 · · Score: 1

      I'm not sure if anyone else does this, but I always set the swap size manually. I try to estimate the total amount of RAM I may need, using 3x my physical ram as a guidline.

      So my 'big' box has 256M of ram, so the swap is set to 768M. On my 'little' box which has only 64M, I set the swap to 384M.

      --
      there are 2 kinds of people. those who divide people into 2 kinds, and those who don't.
    4. Re:Short answer: No hard limit in the OS. by Anonymous Coward · · Score: 0

      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


      Well, that's special... "With the exception that the whole machine goes down in flames when it's overloaded, it's the best I've seen"

  8. 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.
  9. GDI by penguinboy · · Score: 2

    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.

  10. That's still an awful lot of windows. by Telal · · Score: 0, Redundant

    75 windows ought to be enough for anyone. :-)

  11. Why? by Mustang+Matt · · Score: 2

    Who needs that many windows?

    --
    The man who trades freedom for security does not deserve nor will he ever receive either. - Benjamin Franklin
  12. Nobody, on a desktop system by Anonymous Coward · · Score: 0

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

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

  14. It is the GDI resources, not the memory by eean · · Score: 1

    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.

  15. pr0n opened more than that.... by Etrigan_696 · · Score: 1

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

  16. Never hit it by robvasquez · · Score: 0

    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.

  17. Is 70 windows really a limitation? by serutan · · Score: 3, Interesting

    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.

    1. Re:Is 70 windows really a limitation? by tslettebo · · Score: 1

      Hi.

      I've hardly posted to Slashdot, before, but I felt I wanted to, now, because finally I've found somebody else mention this problem, as well.

      As others have pointed out, it's a limit of the GDI-resources, and it's independent of how much memory you have.

      I actually got 256 MB more in my PC (so I now have 384 MB), because I thought it was a memory problem, without it helping, at all.

      I have 384 MB RAM, and I can't have 100 windows?! That's stupid!

      This is actually one of the worst things I know about Windows, and yes, I'm using Windows 2000, the same limitation is there.

      I had 4 MB RAM on my Acorn Archimedes computer, and I never ran into this problem, there. I had just as many windows open.

      They got this right in 1989. Now, 12 years later, and with incredibly more powerful hardware, they still haven't got it right, in Windows. That says some.

      It was asked for an example of how this limit would affect anybody, and I'll happily give that.

      I tend to run into this limit, daily, and I think this limit, and the feature that you can't have the input focus at any other window than the top one (it automatically pops to top), to be some of the most annying things about Windows.

      How I run into this limit?

      It's simple. I tend to open IE windows in separate windows, so I don't get interrupted from the current one, and don't have to wait for them to load, to continue.

      That also makes it easy to go to the other pages, instantly.

      It's very convenient.

      For example, I can read an article, and open any links in it, in new windows, so I don't get interrupted from the current article, and can go to them, later.

      That means I don't get interrupted, and don't have to hunt for links, later.

      Unfortunately, this conveniency is limited by the stupid limit in Windows.

      Has anybody else had problems with this limit? Or are you all just using one window, and jumping in and out of the current article, when following links, and using the Back-button to get back?

      Isn't that very disturbing on the reading?

      Wouldn't it be better to have it in separate windows?

      I've found using separate windows to be a better way of using the browser.

      Regards,

      Terje

      P.S. Has anybody else found all this "My"-stuff to be incredibly infantile? "My Computer", "My Documents", My, My, My! Like a baby.

      There's a very good article on Salon, about this.

    2. Re:Is 70 windows really a limitation? by tslettebo · · Score: 1

      Oh, and by the way, I'm not using Linux, so my posting wasn't a plug for Linux. :)

      One poster mentioned that some may use this limit in Windows, to plug Linux, even if the limit is irrelevant for them.

      I'm using Windows, and I can assure you the limit is very relevant.

      In my opinion, there shouldn't be a hard-coded limit on the number of windows, in an operating system.

      When the size isn't known in advance, use e.g. std::vector, not arrays, and you solve it. :)

      Terje

  18. I wouldn't call it stupidity... by nstenz · · Score: 1

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