0% found this document useful (0 votes)
198 views

Swapping: Consider A Real-Time Example

Swapping is a memory management technique where processes in main memory are swapped out to disk if idle or blocked, freeing up space. When a process is ready to execute, it is swapped in from disk to main memory. This allows the memory requirements of all processes to exceed the amount of physical memory by temporarily storing inactive processes on disk.

Uploaded by

gulzar ahmad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
198 views

Swapping: Consider A Real-Time Example

Swapping is a memory management technique where processes in main memory are swapped out to disk if idle or blocked, freeing up space. When a process is ready to execute, it is swapped in from disk to main memory. This allows the memory requirements of all processes to exceed the amount of physical memory by temporarily storing inactive processes on disk.

Uploaded by

gulzar ahmad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Swapping

Swapping is one of the several methods of memory management. In swapping an idle or


a blocked process in the main memory is swapped out to the backing store (disk) and the
process that is ready for execution in the disk, is swapped in main memory for execution.
We will be discussing swapping in more detail. As we all know, a process must be placed in
main memory for its execution. But, the fact is that we have a limited amount of main
memory. The memory needed by all the processes in the system is often more than the
main memory we have in the system. A process must be in the main memory before it
starts execution. So, a process that is ready for execution is brought in the main memory.
Now, if a running the process gets blocked. The memory manager temporarily swaps
out that blocked process on to the disk. This makes the space for another process in the
main memory. So, the memory manager swaps in the process ready for execution, in the
main memory, from the disk. The swapped out process is also brought back into the main
memory when it again gets ready for execution.

Consider a real-time example:


In Windows operating system, as soon as the system is booted 50-100 process starts
executing, these processes do nothing but check for application updates. Such processes
take up to 5-10 MB memory space. The other processes start checking for the incoming
network, incoming mails and the other things.

Memory Management (Without Swapping or Paging)

Entire process remains in memory from start to finish and does not move. The sum of
the memory requirements of all jobs in the system cannot exceed the size of physical
memory.

 No address translation done by the OS (i.e., address translation


is not performed dynamically during execution).
 Either reload the OS for each job (or don't have an OS, which is almost the
same), or protect the OS from the job.
o One way to protect (part of) the OS is to have it in ROM.
o Of course, must have the OS (read-write) data in ram.
o Can have a separate OS address space only accessible in supervisor
mode.
o Might just put some drivers in ROM (BIOS).
 The user employs overlays if the memory needed by a job exceeds the size of
physical memory.
o Programmer breaks program into pieces.
o A “root” piece is always memory resident.
o The root contains calls to load and unload various pieces.
o Programmer's responsibility to ensure that a piece is already loaded
when it is called.
o No longer used, but we couldn't have gotten to the moon in the 60s
without it (I think).
o Overlays have been replaced by dynamic address translation and other
features (e.g., demand paging) that have the system support logical
address sizes greater than physical address sizes.
o Fred Brooks (leader of IBM's OS/360 project and author of “The
mythical man month”) remarked that the OS/360 linkage editor was
terrific, especially in its support for overlays, but by the time it came out,
overlays were no longer used.

You might also like