Thursday, November 29, 2007

Operating System

Windows virtual memory
The hardware provides for programs to operate in terms of as much as they wish of this full 4GB space as Virtual Memory, those parts of the program and data which are currently active being loaded into Physical Random Access Memory (RAM). The processor itself then translates (‘maps’) the virtual addresses from an instruction into the correct physical equivalents, doing this on the fly as the instruction is executed. The processor manages the mapping in terms of pages of 4 Kilobytes each - a size that has implications for managing virtual memory by the system.
UNIX Virtual memory
"Virtual memory is memory that appears to be allocated to application programs. The operating system uses a portion of the hard disk as virtual memory, and swaps data between the hard disk and physical memory. Virtual memory enables multitasking. If your computer needs to run several programs simultaneously, and the memory that all these programs require exceeds the amount of physical memory available, the operating system allocates virtual memory to meet the total memory requirements of each program, and then manages the available physical memory to meet the actual memory requirements at each point in time. Therefore, the amount of virtual memory that is allocated can be much greater than the amount of physical memory that is installed in the computer."UNIX iformation"
How windows and UNIX handle each faults?
Operating systems such as Windows and UNIX (and other UNIX-like systems) provide differing mechanisms for reporting errors caused by page faults. Windows uses structured exception handling to report page fault-based invalid accesses as access violation exceptions, and UNIX (and UNIX-like) systems typically use signals, such as SIGSEGV, to report these error conditions to programs. "Page Fault" Wikipedia, the free encyclopedia
How windows handle its work sets?
A process can explicitly trim its own working set by calling the SetProcessWorkingSetSize() API while passing "-1" for both the dwMinimumWorkingSetSize and dwMaximumWorkingSetSize parameters. This is essentially how the system trims the process when its top-level window is minimized. This does not mean that the memory pages used by the process are immediately discarded from RAM. In fact, these pages may remain resident for quite a while. They are simply flagged so that the system can use them for other processes as necessary. This is significantly faster than waiting on the system's standard trimming algorithm.
When a window is minimized through the Minimize command from its System menu or the Minimize button, the window is sent a WM_SYSCOMMAND message with the SC_MINIMIZE command. If the window procedure passes this message on to the system's default window procedure by calling DefWindowProc(), the default procedure will handle the message by calling ShowWindow() with the SW_MINIMIZE command. As stated earlier, this will cause the process working set to be trimmed."microsoft help and support"
How UNIX handle its working sets?
How Windows handle page size?
Windows automatically sets the size of the page file to start at 1.5× the size of physical memory, and expand up to 3× physical memory if necessary. If a user runs memory-intensive applications on a system with low physical memory, it is preferable to manually set these sizes to a value higher than default. "Paging in Windows " wikipedia, the free encyclopedia.
How UNIX handle page size?
Operating systems such as Windows and UNIX (and other UNIX-like systems) provide differing mechanisms for reporting errors caused by page faults. Windows uses structured exception handling to report page fault-based invalid accesses as access violation exceptions, and UNIX (and UNIX-like) systems typically use signals, such as SIGSEGV, to report these error conditions to programs.From Wikipedia, the free encyclopedia

No comments: