Memory Management

Memory management is the way in which the operating system allows applications to access the system's memory. This includes the way in which memory is allocated, either to a single application or to be shared by multiple applications. The operating system must check the amount of memory available to an application, and must handle the situation where there is insufficient free memory to satisfy an application's requests.

Memory management under DOS and OS/2 Version 1.3 was achieved using units of memory known as segments, which could be from 16 bytes to 64 KB in size. The memory model implemented by these operating systems was therefore known as a segmented memory model. The use of data structures larger than 64KB required the use of multiple segments, the management of which was the responsibility of the application. This led to increased size and complexity, and reduced performance in applications which handled large data structures.

In OS/2 Version 2.0, memory management has been enhanced to provide a flat memory model, which takes advantage of the 32-bit addressing scheme provided by the Intel 80386 architecture. This means that through memory management, the system's memory is seen as one large linear address space of 4 GB. Applications have access to memory by requesting the allocation of memory objects. Under OS/2 Version 2.0, these memory objects can be of any size between 1 byte and 512 MB. The use of a flat memory model removes the need for application developers to directly manipulate segments, thereby simplifying application development and removing a significant obstacle in porting applications between OS/2 Version 2.0 and other 32-bit environments such as AIX*.

OS/2 Version 2.0 manages memory internally using pages, each of which is 4 KB in size. Each memory object is regarded by the operating system as a set of one or more pages. For practical purposes therefore, memory is allocated in units of 4 KB, although a page may be broken down into smaller parts and may contain multiple memory objects.

One of the useful aspects of paged memory is the way in which memory overcommitment is handled; that is, what happens when there is no more real memory left to load applications or satisfy a request for memory from an application. Under OS/2 Version 2.0, individual pages may be swapped to and from disk storage, rather than entire memory objects. This improves swapping performance, particularly when large memory objects exist in the system. The fixed page size also improves swapping performance since the operating system need not be concerned with moving memory objects about in order to accomodate the various object sizes, as was the case with previous versions of OS/2.

For a more detailed discussion of memory management under OS/2 Version 2.0, readers should refer to OS/2 Version 2.0 - Volume 1: Control Program.


[Back: Intel 80386 32-Bit Microprocessor Support]
[Next: Multiprogramming and Multitasking]