gt24 said:
A quick note on the hardware specs... The processor should be ok for XP, at least from my experiences, but the memory is REALLY low. So, if you want to try to make things run smoother overall, try to see if you can boost the amount of memory you have.
Windows XP can run with less than optimal memory however when Windows exceeds your on chip memory then it uses a virtual memory file on your hard drive. Apparently, your hard drive is much slower than your on chip memory. So, if it needs a random memory value, it tries to load it from chip memory and fails... then it tells the hard drive to start searching for that value there... which in computer terms takes a LONG period of time. The program requesting that memory is now stalled until it gets the memory values that it wants. It wouldn't be nice if, after it retrieves that memory value, that it decides that it needs another... and another...
Drivers on your system allow access to things such as your hard drive. So, although this is more prevalent with 3rd party drivers, hard drive access can take up processor and memory resources. Usually this is built into the normal requirements of the OS though.
I'm not quite sure what is causing the CPU spikes... but if those vanished with a boost in memory I wouldn't be surprised either...
Sidenote... When a memory value isn't in the on chip memory then your hard drive is accessed. Older comptuers mean SLOWER hard drives... so it can exaggerate the problem. Similar issues come up with laptops with slower hard drives (as in diminished performance).
While you have a good idea of what a page-not-present fault is, you're not quite there.
You can't do an operation to a variable on disk in the strictest sense.
Memory is divided into pages on "modern" OSes[1]. On the x86, this page size is 4KB (or as defined otherwise programatically, I do believe you can have larger pages on systems with PAE). This has a few nifty side effects:
1) It can permit programs to have their own address spaces and crash hopefully without wedging the machine.
2) It can permit the OS to free up physical memory by writing pages to a larger, slower memory, such as a hard drive.
A device called the Paged Memory Management Unit (PMMU) is used to determine if memory pages are in memory and if the currently running program has the rights to access them[2]. If a page isn't in memory when a program tries to access that part of its memory and/or the program doesn't have the right to access that page, a page fault is generated (#PF) and the page fault handler is invoked to verify that the process has the right to access that page and if appropriate fetch the requisite page from disk. If there aren't any (physical) RAM pages available, the PF handler has to search for a victim to page out to disk. When you do a lot of paging, you're IO-limited on performance. If the page fault is a "you can't access that" fault, the current process is terminated and you get the nice little "Foobar.exe encountered a problem and blah blah", or, if you're in Kernel Mode, you BSOD. You also BSOD when the paging algorithm screws up and pages out a kernel area that shouldn't ever be paged out -- PAGE_FAULT_IN_NONPAGED_AREA.
Say you have a userland process that executes this statement:
If the (virtual) address that is referenced by foobar isn't in RAM, the page fault handler is invoked to get the page into RAM so the program can frob the variable.
As far as I recall the Windows paging algorithm will endeavor to keep as much physical RAM free as is possible which is why you hear a lot of disk thrashing (among other reasons). Of course, I haven't seen the algorithm with mine own eyes, and neither has anyone else on this forum. (If someone here happens to work for the MS Operating Systems division, I'm curious, and you can correct me if I'm wrong on any of the above. Silly closed-source monopolies.)
Windows WILL NOT run comfortably in under 256MB of RAM, and it should be against the law to sell computers with XP that have less than that much RAM.
Footies ...
[1] Windows doesn't qualify as a Real OS, but it does qualify as modern due to chronology.
[2] That's not all it does. Consult the IA-32 Programmer's Manuals for further information.