Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / Windows XP and an experiment of mine: Why this result?

Author
Message
Mr Z
17
Years of Service
User Offline
Joined: 27th Oct 2007
Location:
Posted: 22nd May 2008 12:55
Hi all.

First I must point out that this will not affect you if you are not a extreme multitasker, it was an experiment I made and I want an explanation for the result. It is NOT meant to compare OSs or state that Windows is in any way inferior. This is only about scientific curiosity about why I get these results. And the results do not in any way inpact on any normal user, not even users with extreme multitasking habbits, because you will propobly never reach this limit unless you don´t try, which was what I did.

Anyway, I read somewhere that if you hold down "Win + E" for 30 seconds in Vista, it will crash. At the moment I "only" got XP installed, so I decided to try in XP, but not in that way. Instead I had Firefox 3 beta 5 up and running (so I could surf the web at the same time as I made the experiment), and hold down the "Win + E" combination for a number of seconds (hardly 30) and released it, then I did let the OS catch up with spawning Explorer windows, and then I pressed again. When I reached 49 windows (not counting the Firefox window) I got a message of running out of memory, and then I could not spawn any more windows of any other application. Not even "ctrl + alt + delete" worked. So, my question is why can XP "only" handle all those Windows (the reason I ask is because when I tried in another OS how many windows I could open I ended up with over 200, even though it was quite slow due to my processor had much to do, but as stated, this is not meant to compare the two OSs or them with any other OS, or state that Windows is inferior, espessially since a normal user will never have to worry about this, and that there are no practical inpacts on user experience, I just want to know the reason for why my XP can handle about 50 windows when I have proven that my hardware can handle much more then that).

My specs are:

* Almost 3 gb ram (have 4 installed, but not all can be found).
* AMD processor with about 1.8 GHz (3500+).

My theory is that Windows have a inbuilt "limitation" for some reason, like protecting itself or the user from something or something like that, but I do not know why. But I do not know.

So, can anyone explain this limit for me?

Take care,
Mr Z.

Darkness, you haunt me. If I give in, I would be an monster beyond imagining. Light, you guide me. Thanks to you, I see past the nothingness. Life, I choose to live in the light.
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 22nd May 2008 14:21
If Windows is handled anything like how older OS's are, then it stores the backdrop of each window, this allows it to quickly update the screen without needing to redraw all the windows behind one that has just been closed.

So if we do some math, assuming standard bitmap sizes of DWords per pixel and a window size of 1024x768... each one would take around 3million bytes, or 3mb, 3mb x 50 windows = 150mb, just for backbuffer images. Not very much in the long run, but it depends what else is stored for each window, possibly an active image for each, then the program workspace itself - I mean typing this post, Firefox is using 50mb of memory, multiply that by 50 copies and your talking around 2.5gb!


less is more, but if less is more how you keeping score?
IanG
20
Years of Service
User Offline
Joined: 25th Sep 2004
Location: Cyberspace
Posted: 22nd May 2008 14:29
each window takes up a certain amount of memory as standard, in fact every process takes up a certain amount of memory even before the first line of code is run in it. so theres a limitation to how many you can run before windows will stop you from opening any more. then theres a fact that firefox can get extremely resource hungry - i had around about 8 tabs open the other day on the warwick uni website and i looked in task manager and it was using a good 300megs of memory, so it also depends on what other programs you have got running (and that includes general processes like your av and firewall)

Quote: "when I have proven that my hardware can handle much more then that"

your hardware doesn't have a limit on it, the amount of memory used is split up for every process, for example if you are running linux on it with a xfce or another light weight windows manager then you will get more windows, say that in xfce each windowed process takes up about 2megs of ram and windows would take more, possible 4 or 5 megs, which would be the start of the limitation, plus the fact that most windows machines have hundreds of processes doing very little where as linux only has what is needed at that time - all processes take up memory and therefore windows whilst having all these idling processes is taking up memory that could be used for such things as creating a million windows

amd athlon xp 2600+,1280mb,FX 5200 128mb,200gb & 120gb,xp pro sp2
Mr Z
17
Years of Service
User Offline
Joined: 27th Oct 2007
Location:
Posted: 22nd May 2008 18:47 Edited at: 22nd May 2008 18:55
Quote: "If Windows is handled anything like how older OS's are, then it stores the backdrop of each window, this allows it to quickly update the screen without needing to redraw all the windows behind one that has just been closed.

So if we do some math, assuming standard bitmap sizes of DWords per pixel and a window size of 1024x768... each one would take around 3million bytes, or 3mb, 3mb x 50 windows = 150mb, just for backbuffer images. Not very much in the long run, but it depends what else is stored for each window, possibly an active image for each, then the program workspace itself - I mean typing this post, Firefox is using 50mb of memory, multiply that by 50 copies and your talking around 2.5gb!"


Interesting. Did not know that older OSs did that.

But I made some more checks, and it seems that the "limit" is between 50-60 windows. I managed to have the Task Manager active by pressing "ctrl + alt + delete" before I spawned all those open folders, and when Firefox was not running, my RAM usage never rose above 400 mb... so it appears that it is not the memory that is the reason for this.

But also note that I´m talking about opening folders now, I do not have 50 instances of Firefox running.


Anyway, I read somewhere about the differences between how UNIX and old DOS would handle an input where the user, as an example, typed a command and then entered a paramiter like this one:

*.jpg

In UNIX it would run a the command for all .jpg files in the folder, each one would get an own instance, while DOS did something else (both ways had their advantages and disadvantages). Can it be something like that, that Windows handles processes in a way that creats some kind of limit with 50-60 windows (but that you gain in some other way), or is it something else?

Quote: "your hardware doesn't have a limit on it, the amount of memory used is split up for every process, for example if you are running linux on it with a xfce or another light weight windows manager then you will get more windows, say that in xfce each windowed process takes up about 2megs of ram and windows would take more, possible 4 or 5 megs, which would be the start of the limitation, plus the fact that most windows machines have hundreds of processes doing very little where as linux only has what is needed at that time - all processes take up memory and therefore windows whilst having all these idling processes is taking up memory that could be used for such things as creating a million windows"


Ok, might have used the wrong words. Meant that my memory and my processor should be able to handle more windows then they can, sorry for making that unclear.

EDIT:

Ok, that theory of mine seem to be quite far fetched, just don´t understand it...

Can anyone else try and see if you get the same result as me?

Darkness, you haunt me. If I give in, I would be an monster beyond imagining. Light, you guide me. Thanks to you, I see past the nothingness. Life, I choose to live in the light.
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 22nd May 2008 21:19
Remember that all he is doing is opening explorer windows; there is only a single process being used for this. Also, I don't think the visual data of each individual window is stored, seeing as it isn't so costly to just to do the re-calculation when necessary. I'm not sure myself why you get the results you do.

Quote: "plus the fact that most windows machines have hundreds of processes doing very little where as linux only has what is needed at that time"

Interestingly, On XP I have on average 40 processes running at one time, whereas last time I used Ubuntu there were an average of 60 processes. Of course, this is all down to the distro.

Mr Z
17
Years of Service
User Offline
Joined: 27th Oct 2007
Location:
Posted: 22nd May 2008 21:58
It also matters on what you have on your computer. You can strip XP, just as any other OS, down so it does not have that much running.

Quote: "Remember that all he is doing is opening explorer windows; there is only a single process being used for this."


This might also have something to do with it, but I´m not sure, since I think I was not able to open any application when I reached that strange "limit", but I have not tried that so much, so I will.

Darkness, you haunt me. If I give in, I would be an monster beyond imagining. Light, you guide me. Thanks to you, I see past the nothingness. Life, I choose to live in the light.
Jeff032
17
Years of Service
User Offline
Joined: 13th Aug 2007
Location:
Posted: 23rd May 2008 01:26
I opened 48 explorer windows before I couldn't open any more. I didn't get an error message, and my computer was still running smoothly. My RAM was sitting at 15%, and started at 14% (I have 3.25 GB recognized out of 4)

On Vista Business x64 I got about 80 explorer windows before I got bored. It was still running smoothly.

Lazlazlaz 1
19
Years of Service
User Offline
Joined: 18th Sep 2005
Location: England
Posted: 23rd May 2008 02:25
I did a similar experiment a while back with the XP Calculator. It reached nearly 200 (if I remember rightly) before it stopped. It didn't crash or show significant slow down, just stopped letting me create more windows.

As with most people I jump around which projects I work on and which I drop for a while.
Currently I'm back working on Sioux, a Hollywood Western RTS.
Preston C
21
Years of Service
User Offline
Joined: 16th May 2003
Location: Penn State University Park
Posted: 23rd May 2008 04:33 Edited at: 23rd May 2008 04:36
I just tried the experiment here (Win+E for 30 seconds). 96 Windows Explorer windows have opened according to Task Manager, with 100 windows open in the system total, fifty total processes running, and explorer has locked up. Yet, at the moment Explorer.exe is only using 123 MB of RAM, less than an average Firefox session.

Everything else is running smoothly though. The way it was worded in the OP, I thought it was going to blue screen

AMD Opteron 185 Dual Core 2.6 Ghz | 2 GB RAM | 8800 GTS 640MB | Vista Home Premium 32 Bit
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 23rd May 2008 05:25 Edited at: 23rd May 2008 05:26
It's also interesting to note that for each explorer window opened, an extra thread is created, which of course requires its own memory.

David R
21
Years of Service
User Offline
Joined: 9th Sep 2003
Location: 3.14
Posted: 23rd May 2008 11:29
Is it possible that Windows is running out of HWNDs / handles? I'm not sure what datatype it uses for those, but considering it was implemented at the beginning of 16 bit win api, it's possible they're still defined as short ints or something (and with all the stuff associated with the window - e.g. the window itself, resources, and as Benjamin said, the thread, it could be exceeding that limit).

Highly unlikely it's still a short datatype... Worth a shot though


09-f9-11-02-9d-74-e3-5b-d8-41-56-c5-63-56-88-c0
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 23rd May 2008 15:33
Opening a new thread will automatically allocate a stack for that thread - depending on the application, you can have anywhere from 1MB upwards allocated each time. That means you have an absolute maximum of 2048 threads for any single process, and in reality, it's far less because most processes use a larger stack (e.g. 10 MB).

Note that just because the memory is reserved for the stack, it may not actually be committed, so your measures of available memory may not reflect that (i.e. they'll show lots of free memory).

If you take that into account, along with other memory usage (loaded & injected DLLs, heap memory allocation, shared memory etc), it's quite understandable that you're seeing different limits depending on your system.

Mr Z
17
Years of Service
User Offline
Joined: 27th Oct 2007
Location:
Posted: 23rd May 2008 16:20 Edited at: 23rd May 2008 16:21
IanM,

so you are meaning that it is a matter of reserved memory? That the memory might not be used all way to the top, so to speak, but it is reserved by Windows, so I cannot spawn more applications or threads because they do not have permission to use the memory because it is reserved? Or have I misunderstood what you meant (do not know what you mean by stack)?

Darkness, you haunt me. If I give in, I would be an monster beyond imagining. Light, you guide me. Thanks to you, I see past the nothingness. Life, I choose to live in the light.
NeX the Fairly Fast Ferret
19
Years of Service
User Offline
Joined: 10th Apr 2005
Location: The Fifth Plane of Oblivion
Posted: 23rd May 2008 19:26
I've opened 2047 Firefoxes before just to see what would happen, at which point I received "WIN_MAX_FORM" in an error box. It took over an hour to reach it. I accomplished this by leaving a heavy book on the Internet shortcut key.


I fail at life. No, really.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 23rd May 2008 21:28
@Mr Z.
Stack : http://en.wikipedia.org/wiki/Call_stack
It's current working storage in memory used to pass parameters when calling functions/procedures, to hold local variables and to hold return addresses (function a calls function b. When function b ends, the program has to know where to return to in function a - this is stored on the stack).

Quote: "Or have I misunderstood what you meant"

No, I think you've got it.
Compare it to staying at a hotel. You reserve the room - it's empty, but no-one else can use it. When you turn up, the room is committed to you.

Actually, turns out the maximum number of threads can be higher if you work at it: http://blogs.msdn.com/oldnewthing/archive/2005/07/29/444912.aspx

Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 25th May 2008 02:14
Windows does NOT store backdrops for each window, UNLESS the programmer chooses to do so in the window class' they create. Buttons, edits (Text inputs, text boxes, password inputs), progress bars, tabs, etc are all windows in Windows. Now, from my understanding you made 49~ internet explorer windows. Internet Explorer has a web browser, and probably (instead of rendering the buttons and edits like I assume firefox and other browsers do) create additional windows for those buttons and such. Now, each page obviously takes up a certain amount of memory, and IE is rather messy IMO - with tons of interfaces everywhere for the stupidest of things - and that's JUST the web browser control, that's not even the entirety of IE. Then there's all the tabs, and toolbars. I *assume* toolbars are additional programs or DLLs, so that's a ton more memory right there. Making 49 IE windows is like telling your computer to go kill itself from that.

Maybe I misinterpretted what you said though. TRY to do the same experiment with JUST mozilla firefox windows. Or perhaps just blank windows (I can very easily, and quickly make a program to do that).

Also keep in mind each process does take up a memory foot print, and each process takes up about 15 milliseconds of computing time in WXP. So that can make searches for memory slower - maybe (though unlikely) Windows has a "time-out" thing for memory to keep the system running fast? I doubt that, but it's entirely possible.

Cheers,

-naota

I used to do a lot of time traveling when I was younger. I called it tequila. I would drink this potion and wake up 3 days in the future! 'Where am I trusty dumpster? Get me home!' - Craig Ferguson
flickenmaste
16
Years of Service
User Offline
Joined: 2nd May 2008
Location:
Posted: 25th May 2008 08:46
a good way to freeze ur pc...if u have ALOT of icons on ur desktop like me...highlight them all and then press enter

What you know wont hurt you- except me
Mr Z
17
Years of Service
User Offline
Joined: 27th Oct 2007
Location:
Posted: 25th May 2008 22:15 Edited at: 25th May 2008 22:23
Quote: "Windows does NOT store backdrops for each window, UNLESS the programmer chooses to do so in the window class' they create. Buttons, edits (Text inputs, text boxes, password inputs), progress bars, tabs, etc are all windows in Windows. Now, from my understanding you made 49~ internet explorer windows. Internet Explorer has a web browser, and probably (instead of rendering the buttons and edits like I assume firefox and other browsers do) create additional windows for those buttons and such. Now, each page obviously takes up a certain amount of memory, and IE is rather messy IMO - with tons of interfaces everywhere for the stupidest of things - and that's JUST the web browser control, that's not even the entirety of IE. Then there's all the tabs, and toolbars. I *assume* toolbars are additional programs or DLLs, so that's a ton more memory right there. Making 49 IE windows is like telling your computer to go kill itself from that.

Maybe I misinterpretted what you said though. TRY to do the same experiment with JUST mozilla firefox windows. Or perhaps just blank windows (I can very easily, and quickly make a program to do that).

Also keep in mind each process does take up a memory foot print, and each process takes up about 15 milliseconds of computing time in WXP. So that can make searches for memory slower - maybe (though unlikely) Windows has a "time-out" thing for memory to keep the system running fast? I doubt that, but it's entirely possible.

Cheers,

-naota"



Yeah, but it was not 49 IE windows and 1 Firefox window, it was 49 windows explorer windows (the shell) and 1 Firefox window. So you missed that detail . Tried opening a few IE instances, think 3, but I still did get about 50 windows as a total.

Anyway, the RAM is not used more then about 300-500 mb when I reach the limit, so it is not that the memory is running out. Think IamM´s explanation seem to be the most logical, but I have also thought it might be some way (as you proposed) to prevent the computer from performing too bad or something, but what IanM suggested sound more logical.

Quote: "a good way to freeze ur pc...if u have ALOT of icons on ur desktop like me...highlight them all and then press enter"


Then mark everything in all of them and press enter if the computer has not died yet... but I somehow think this limitation actually would prevent that from happening.

A better way that I have heard about but never tested is to create a shortcut to itself. I have heard that it would bring up a BSOD (do not remember if you had to use it or not).

Darkness, you haunt me. If I give in, I would be an monster beyond imagining. Light, you guide me. Thanks to you, I see past the nothingness. Life, I choose to live in the light.

Login to post a reply

Server time is: 2024-11-20 06:24:31
Your offset time is: 2024-11-20 06:24:31