Home     aDirectory     wServer     FAQs     Forms     test_form     How_to     Map_our_site     Definitions      
See_BIG_picture
01005_Use_UserMode
01005_Apply_SubSystem
01007_Call_Integral_SubSy
01007_See_kernel_mode
01008_Manage_IO
01008_Manage_security
01008_Manage_comm
01008_Manage_memory
01008_Manage_processes
01008_Manage_PlugNPlay
01008_Manage_power
01008_Manage_displays
01008_Manage_graphs
01009_Drive_devices
01008_Manage_objects
01009_Use_Microkernel
01009_Call_HAL
01011_Administer_SERVICEs
01012_Use_Mgt_Console
01012_Unify_server_client
01013_Apply_group_policy
01013_Use_99_times_out_
01016_Integrate_services
01017_Use_namespaces
01018_Manage_branch_offic
01019_Serve_terminals
01024_Use_DIRECTORY
Manage Memory to:
-- Provide a virtual address space for each process
-- Protects virtual address space and maintain system integrity 
-- Control the demand for access (paging) to the hard disk for virtual RAM.
 
Manage memory -- on a flat linear, 32-bit, address space.
Two types of memory are used.
- Physical memory is in the RAM chips on the motherboards.
- Virtual memory combines all memory made available to the OS.

Manage 'virtual memory in the operating system:

- Combines all physical memory in an OS so the applications have more memory available to them than the limits of the capacity of the RAM chips installed in the system.

- Protects the memory resources by preventing one process from violating the memory address space of another process.

Every memory byte, (physical or virtual), is represented by a unique address.

Physical RAM has limits because wServer can address the memory as per the amount of physical RAM in the system.
But, virtual addressing is another story.

The VMM manages the memory and has the following two major functions:
- Maintains a memory-mapped table to track the list of virtual addresses assigned to each process. It coordinates where the actual data maps to the addresses.
- Maps the virtual memory to the physical memory.
This is transparent to the apps and continue to act as if they have access to physical memory.

- If RAM is maxed out, the VMM moves the memory contents to the hard disk, as needed.

This process is known as paging.

Thus, wServer has access to a virtual 4GB address space made up of both RAM and hard-disk space.
Although a 4GB address space is stated, this space is relative to how the system uses memory.

Actually, the address space available to apps is only 2GB and is even less than that, because the 2GB assignment is shared by all processes running in user mode, and the other 2GB assignment is reserved for kernel mode threads.

The default address space uses the 3GB switch or the 'Physical Address Extension' (PAE) to get beyond the 4GB barrier.

Consider the upper and lower part of the 4GB space, both containing 2GB addressing.

The upper space (part) is reserved for kernel mode processes only.
The lower space (part) is reserved for both user mode and kernel mode processes.
The upper part reserves certain lower regions of address space to map directly to the hardware.
The lower part is maintained in 'paging pools'.
The lower part has a 'nonpaged pool' and a 'paged pool'.
The paged pool can be swapped out to disk and is usually assigned to applications.
The nonpaged pool must remain in physical RAM. The size of each page is 4K.

Paging is the process of moving data in and out of physical memory.

If the physical memory pool is filled and the OS needs more,
then VMM reallocates data that is not needed in the physical memory out to the disk in a repository known as the page file.

Each process is assigned address space in pages.
The pages are identified as either valid or invalid pages.
The valid pages are located in the physical memory and are available to the application.
The invalid pages are not available to any application.
The invalid pages are stored on disk.
When apps need access to data that was moved to offline memory as an invalid page
then the system acknowledges this need as a 'page fault'.

A 'page fault' process is similar to a thread of execution that takes a different route in terms of routines after it encounters an error or exception. 

In this case, the page fault is handled intentionally, and the VMM "traps" the fault, accesses the data in the page file that relates to it, and restores it to RAM.
Other data that is now no longer needed is bumped out and sent offline to disk.

The VMM performs the following series of housekeeping chores as part of the paging routines:
The VMM manages the data in the page file on disk on a first-in, first-out basis.
Thus, when RAM is free then the oldest data on the disk is returned to the physical memory - first.

If the RAM has surplus space and the page file has data
then the VMM moves the data back to RAM.
If the page file has no data then clearly the movement of data back to RAM stops.
The data managed by VMM is the 'working set'.

The VMM performs what is known as fetching as it brings back data from the page file.

Also, the VMM performs 'page file clustering'.
Page file clustering means that as the VMM fetches, it also brings back some of the surrounding data in the page file, on the premise that data immediately before and after the required data may be needed in the next instant as well. This process speeds up data I/O from the page file.

The VMM determines if no space is present in RAM to place fetched data, then it must first move out other recent data to the page file before attempting to place the fetched data back into faster RAM.
The operations of VMM and the factors, like the size of the page file, can be managed by an admin.

See the performance management and troubleshooting techniques in Ch24.