Академический Документы
Профессиональный Документы
Культура Документы
Degree
Program: Diploma In IT
Assignment
No: 01
Assignment
Title: Working Set Model and Locality
Date Of
Submission: 10th May 2008
ID No: PESBI72
2
Executive Summary
This technical report explains the working set model and locality of
reference and how it is applied to different operating systems. Moreover, it
illustrates virtual memory management and the comparison of this, concerning two
real operating systems.
Virtual memory has become a vital requirement over the years, as the cost
of secondary memory decreases, and the memory demands of software increase. In
order to balance the use of primary memory among processes, sophisticated
algorithms are necessary to manage the replacement of virtual pages. This report
outlines the pros and cons of a variety of solutions, including both static based
demands and dynamic pre-fetch replacement algorithms.
3
4
Background Information
In computer systems main memory is divided into two parts, one part
for the operating system and the other part for the program currently being used.
In operating systems there are procedures for optimizing the use of random
access memory. These procedures are collectively identified as memory
management. Selectively storing data, monitoring it carefully and freeing
memory when the data is no longer needed, are all part of these procedures.
Memory management in programming is the process of ensuring that a program
releases each chunk of memory when it is no longer needed. The task of
subdivision is carried out dynamically by the operating system and is known as
memory management. In memory management, there are vital concerns memory
management expects to fulfill. They are;
5
modules. The operating system and hardware should support a basic form of
module to provide the necessary protection and sharing.
6
Locality is the tendency of programs considering their references over any
given interval of time, to a subset of the paces of the program, and for this subset
to change rather slowly with time. Locality is the point to which a program keeps
memory references limited to a small number of locations over any short length of
time. The better the locality of reference, the more likely a program will execute
entirely from the cache memory. The more scattered a programs’ memory
references, the higher the chance that it will access main memory, while the worse
that can happen being loading a page from swapping area.
Discussion
The two basic types of locality
The concept of locality is typically used to determine the number of
assigned pages. The ability to design operating systems that is maximally efficient
depends on many factors. Among those, the most important is our understanding of
the concept of locality.
7
An item of information that has just been referenced in a particular level is
very unlikely to be referenced again in a short time even though the program makes
repeated references to it. This is because a copy of that information exists at a
higher level and, consequently, references will not filter down to the lower level. As
a result, the spatial locality of the program would have to be measured at every
level. “It would be far better if the model of spatial locality were such that it was a
function of only the program and not of the level in the hierarchy.” This was signified
by Rau, B. R. (1975). In other words, the spatial locality should be modeled such
that it is an invariant in the hierarchy. The temporal locality, on the other hand, will,
most definitely, be a function of the level in the hierarchy. It should not, however, be
characterized so as to be a function of the spatial locality. Accordingly, the temporal
locality must be characterized in terms of the smallest unit of information that the
processor is capable of requesting. This might be larger than the smallest
addressable unit. This is the natural choice by default, a smaller page size being
meaningless.
8
Virtual memory has been a feature of Microsoft Windows since Windows 3.1 in
1992. 386SPART.PAR (or WIN386.SWP on Windows 3.11 and Windows for
Workgroups) is a hidden file created by Windows 3.x for use as a virtual memory
swap file. It is generally found in the root directory, but it may appear elsewhere
(typically in the WINDOWS directory). Its size depends on how much virtual memory
the system has set up or user define “under Control Panel - Enhanced under "Virtual
Memory"”. This page file is located at C:\pagefile.sys on all NT-based versions of
Windows (including Windows 2000 and Windows XP), though Windows may be
configured to place additional page files on other drives. Eskicioglu, & Marsland,
(n.d)
The Windows virtual memory manager controls how memory is allocated and
how the paging is performed. The memory manager is designed to operate over a
variety of and use page sizing ranges from 4 Kbytes to 64 Kbytes. Intel, PowerPC,
and MPIS platforms have 4096 bytes per page and DEC Alpha platforms have 8196
bytes per page. Stallings, W (1990, p.379-380).
9
references.
0x80000000 to 0xFFFFFFFF: system address space. This 2-Gbyte Process is
used for the Windows Executive, microkernal, and device drivers.
Windows paging
When a process is created, it can in principle make use of the entire user space
in 2 Gbytes (minus 128 Kbytes). Stallings, W (1990, p.379-380) says that “this
space is divided into fixed-size pages, any of which can be bought into main
memory.” In practice, the accounting, page can be in one of three states, they are
available, reserved and committed. Stallings, W (1990, p.379-380).
When main memory is plentiful, the virtual memory manager allows the
resident sets of active processes to grow.
When memory becomes scarce, the virtual memory manager recovers memory
for the system by moving less recently used pages out of the working sets of active
processes, reducing the size of those resident sets.
10
three levels of paging. With 64-bit addresses, the use of only two levels of pages on
the alpha would result in very large pages and directories. The 32-bit Pentium/x86
architecture has a two-level scheme by defining the size of the page middle
directory as one.
Page allocation, Page replacement algorithms and page replacement are some
of the mechanisms used in dealing with contiguous blocks of pages. See Stallings,
W. (1998, p. 378)
Current trends
Future trends
11
systems to make cooperative resource management decisions. In addition, research
must look at resource management at the entire data center level, and can be
expected to make significant strides in this area in the coming years.
Analysis of virtual memory proves that its concept is not only feasible, but
extremely useful and a necessity in ever-growing computer systems where high
speed primary memory is limited.
In the future we will see the size of memory considerably very high and
they will be affordable. Effective and more efficient ways of memory management
will be found. In order to make the best use of multiple levels of memory, such as
cache to make a program run faster, or, paging to make fuller use of the RAM; a
way of predicting which chunk of memory will be required by the program, can be
expected in the near future. Fortunately, many programs exhibit a high degree of
locality in their memory reference patterns. Eventually this concept can be used in
designing both the hardware of a computer, the structures and algorithms of an
operating system.
12
References
• Garfinkel, T., & Rosenblum M. (2005, May) VMware Inc. Available WWW:
www.stanford.edu/group/comparch/papers/Computer_RosenblumGarfinkel.pd
f [access date 24/04/2008]
• http://www.computerworld.com/action/article.do?command=viewArticleBasic
&articleId=60855&pageNumber=2 [Access Date 11/04/2008]
• Madnick, S.E., & Donavan J.J. (1997), Operating systems, (fifth edtion), Tata
McGraw-Hill Publishing Company Limited New Delhi
13
Bibliography
• Garfinkel, T., & Rosenblum M. (2005, May) VMware Inc. Available WWW:
www.stanford.edu/group/comparch/papers/Computer_RosenblumGarfinkel.pd
f [access date 24/04/2008]
• http://www.computerworld.com/action/article.do?command=viewArticleBasic
&articleId=60855&pageNumber=2 [Access Date 11/04/2008]
• Madnick, S.E., & Donavan J.J. (1997), Operating systems, (fifth edtion), Tata
McGraw-Hill Publishing Company Limited New Delhi
14
• Stalling, W. (2005). Operating Systems: Internals and Design Principles. New
Delhi: Prentice-Hall of India Private Limited
15