Skip to main content

7.Operating System - Memory Management



Process Address Space: The process address space is the set of logical addresses that a process references in its code.

Static vs Dynamic Loading: The choice between Static or Dynamic Loading is to be made at the time of the computer program being developed. If you have to load your program statically, then at the time of compilation, the complete programs will be compiled and linked without leaving any external program or module dependency.

If you are writing a dynamically loaded program, then your compiler will compile the program and for all the modules which you want to include dynamically, only references will be provided and the rest of the work will be done at the time of execution.

At the time of loading, with static loading, the absolute program (and data) is loaded into memory in order for execution to start.

If you are using dynamic loading, dynamic routines of the library are stored on a disk in re-locatable form and are loaded into memory only when they are needed by the program.

Static vs Dynamic Linking: As explained above, when static linking is used, the linker combines all other modules needed by a program into a single executable program to avoid any runtime dependency. When dynamic linking is used, it is not required to link the actual module or library with the program, rather a reference to the dynamic module is provided at the time of compilation and linking.

Swapping: Swapping is a mechanism in which a process can be swapped temporarily out of the main memory (or move) to secondary storage (disk) and make that memory available to other processes. At some later time, the system swaps back the process from the secondary storage to the main memory. Though performance is usually affected by the swapping process it helps in running multiple and big processes in parallel and that's the reason Swapping is also known as a technique for memory compaction.

Memory Allocation (Low Memory, High Memory):

  • Low Memory -- Operating system resides in this memory.
  • High Memory -- User processes are held in high memory.

Fragmentation: As processes are loaded and removed from memory, the free memory space is broken into little pieces. It happens after sometimes that processes cannot be allocated to memory blocks considering their small size and memory blocks remain unused. This problem is known as Fragmentation.

Paging: A computer can address more memory than the amount physically installed on the system. This extra memory is actually called virtual memory and it is a section of a hard that's set up to emulate the computer's RAM. The paging technique plays an important role in implementing virtual memory.

Paging is a memory management technique in which process address space is broken into blocks of the same size called pages (size is the power of 2, between 512 bytes and 8192 bytes). The size of the process is measured in the number of pages.

Segmentation: Segmentation is a memory management technique in which each job is divided into several segments of different sizes, one for each module that contains pieces that perform related functions. Each segment is actually a different logical address space of the program.

Comments

Popular posts from this blog

CPP

Basics Downloading and installing CodeBlock Creating and explaining first project Hello World – the terms (keyword, main, header file) Keyword – Keywords are reserved words for compiler whose purpose is already defined in compiler and user cannot use for personal use. E.g if, else, double, switch main – main is a necessary function to define to execute C/C++ program. Without main, we cannot run our program. Header file  - header file contains functions that perform certain tasks  Characters \n, \t, \a data types: int – 4b, float – 4b, double – 8b, char – 1b, string – equal to the number of characters variable: rules to define a variable cannot start with numbers and special characters. Only special character acceptable is _ e.g. _age Camel case: weightInKg Snake Case: weight_in_kg declaration vs initialization arithmetic operations (+, -, *, /, %) input from user – cin, getline() relational operators (>=, <=, >, <, ==, !=) if selection statement if…else – double s...

3.Operating System - Services

Program Execution: The OS is responsible for executing programs. It loads the program into memory and executes the program. Program execution also includes process sync, process communication, and deadlock handling.  I/O Operation :  An I/O subsystem comprises I/O devices and their corresponding driver software. I/O operation means read or write operation with any file or any specific I/O device. OS provides the access to the required I/O device when required. File System Manipulation:  A file represents a collection of related information. A file system is normally organized into directories for easy navigation and usage. The operating system gives the permission to the program for operation on file. Permission varies from read-only, read-write, denied, and so on. Operating System provides an interface for the user to create/delete files. Operating System provides an interface for the user to create/delete directories. Operating System...

OS Outline

Operating System - Overview OS Definition Memory Management  Processor Management  Device Management  File Management  Security  Error Detecting Aids  Job Accounting Operating System - Types  Batch Operating System Time-sharing Operating System Distributed Operating System Network Operating System Real-time Operating System Hard real-time Operating System Soft real-time Operating System Operating System - Services Program Execution  I/O Operations  File System Management  Communication  Error-handling  Resource Management  Protection  Operating System - Properties  Batch-processing Multi-tasking Multi-programming Interactivity  Real-time system Distributed Environment  Spooling  Operating System - Process Process Program Process Control Block (PCB) Operating System - Process Scheduling Definition Process Scheduling Queues Job Queue Ready Queue Device Queue Two-State Process Model  Running...