Logical vs Physical memory
A computer’s physical memory (RAM) is a hardware structure consisting of a linear sequence of words that hold a program during execution.
A word is a fixed-size unit of data. The size of a word is reflected in many aspects of a computer’s structure and operation. A typical word size is 4 to 8 bytes in a modern desktop computer (32-bit and 64bit). Older systems could be as small as a single byte, or might even use completely different systems. –https://en.wikipedia.org/wiki/Word_(computer_architecture)
The size of the word is used all over the place in creation of the processor, and specially processors may have larger or smaller word sizes depending upon their needs.
A physical address is an integer in the range [0 : n-1] that identifies a word in a physical memory of size n.
During the software development process, the starting address of a program in physical memory is unknown. And it may even vary as it is loaded each time.
To facilitate development and the sharing of physical memory, the concept of a logical address space is employed.
A logical address space is an abstraction of physical memory, consisting of a sequence of imaginary memory locations in a range [0 : m-1], where m is the size of the logical address space.
The used portion of the memory is also stored on the HDD/SDD. When the computer needs to use it, it’s memory is loaded from the long term storage into physical RAM. When it is not needed, that section of RAM is overwritten. When it is needed again, it is loaded off of the HDD/SDD.
A logical address is an integer in the range [0 : m-1] that identifies a word in a logical address space.
Relocation
Program relocation is the act of moving a program component from one address space to another. The relocation may be between two logical address spaces or from a logical address space to a physical address space.
Static relocation binds all logical addresses to physical addresses prior to execution.
Dynamic relocation postpones the binding of a logical address to a physical address until the addressed item is accessed during execution.
A relocation register contains the physical starting address of a program or program component in memory.
Free Space Management
First-fit always starts the search from the beginning of the list and allocates the first hole large enough to accommodate the request.
Next-fit starts each search at the point of the last allocation. This is relatively quick because once it finds a spot, it places the memory needed from where you are, without having to go back through existing memory segments.
Best-fit searches the entire list and chooses the smallest hole large enough to accommodate the request. This can be slow because you have to search every possible “hole” to figure out where to fit it. But it does the best job in preserving large holes for future processes to enter.
Worst-fit takes the opposite approach from best-fit by always choosing the largest available hole for any request. – My professor when I took my OS class 20 years ago, called this stupid, and “sometimes author’s just like to hear themselves talk.”
Requirements for Efficient Memory Management was originally found on Access 2 Learn