Quote:
Original post by AndyEsser
Running a Windows machine with no Pagefile is guaranteed to fail eventually.
The only thing guaranteed in this world is that we die.
Quote:
Once you start running more and more memory intensive applications it'll start to cause a problem
There are two types of applications - those that fit fully into RAM - and those that run on clusters.
But I'm honestly curious - which applications are that?
Quote:
as soon as you hit the physical memory maximum your machine will either BSOD
No.
It will BSOD if you use pagefile. Bear with me:
- OS sees a process is using up memory, and starts paging first the applications, then services, then everything pageable, including parts of OS
- OS runs out of pagefile, the offending application triggers heap alloc failure, which is either handled by app or not.
- If offending application crashes/faults, its window is closed or it loses focus - but disk is slow, and isn't cleared instantly, so there is still no memory left.
- Suddenly, OS moves focus to crash dialog or another application
- Since that application is paged, it needs to be loaded into RAM. But there is no RAM, and there is no pagefile, since offending process still hasn't released memory - that application/window manager/something fails.
- And voila - cascading failure, which eventually results in OS parts being unable to page themselves back.
While Windows can recover the above cleanly, there is a chance of catastrophic failure.
Without pagefile - this doesn't happen. OOM with pagefile is the absolute worst combination of failures.
What can happen is that in the short period when system runs out of memory, another process tries to make a heap allocation, and that one fails.
There are two failure modes:
- Fragmentation, where there isn't an adequately sized continuous memory (no problem, if OOM, there is still plenty of memory left for OS to have some breathing room)
- Memory leak. If these grown in under 4k increments, they have the potential to exhaust entire memory - but it takes time to gobble up 8GB. And isn't that hard to notice.
And if running 32-bit apps on 64-bit machine with 4GB+ of RAM, it's a non-issue. The process will grow to 2GB max.
Quote:
become unresponsive
No. System becomes unresponsive when working with pagefile. It *never* becomes unresponsive due to OOM when not using pagefile.
Quote:
or just altogether fail.
When a process makes a heap allocation, and that fails, it's up to original developers to handle that. If they don't, application terminates. There is nothing inherent that should crash the system. At least I've never seen it.
Seriously - get 8GB or 16GB of RAM, then turn off the pagefile. I'll be very hard to convince that desktop work breaks that.
Disclaimer: this is solely about desktop usage - servers have different requirements, where pagefile may or may not be required, again depends on whether virtualization is used, long-running processes, etc.
----------
A different demonstration of pagefile catastrophic failure:
foo() {#1 Data someLocalDataAbout16kb_maybepointer_maybeRAII;#2 consume16kb();}
In #2, there is no more RAM, so someLocalData is paged to disk (just barely).
OS then tries to allocate 16kb, but there is no RAM, there is no pagefile. heap allocation fails, and whether application chooses to handle it or not, someLocalData first needs to be paged back. This takes a lot of time.
Meanwhile, some other part of OS, some other application runs and part of that is paged into RAM.
Back in foo(), foo() is stack unrolled, exception handler tries to print a helpful message, which causes hundreds of DCs to be created, WM_ to be sent - all into an OOM system. And all of these actions causing page swaps.
If everything is in RAM - when OOM, stack is unrolled, and that's it. Ironically, trying to gracefully handle OOM in application can cause more problems than just exit() would. As a rule, OOM handling should not consume any memory at all, but that is wishful thinking, especially for C++ apps which make liberal use of rich exceptions, where implicit allocations occur all over the place, whether intended or not. I don't think any software is adequately tested for this type of edge case (not that there is any real need).
[Edited by - Antheus on June 1, 2010 6:35:02 AM]