... continued from our previous discussion ...
-fragmentation - is a condition in which address spaces in memory are not contiguous.
-in other words, the address spaces are interspersed by blocks of memory that are unused.
-these blocks are unused as they are not sufficiently large to house address spaces belonging to any process.
-fragmentation causes inefficiency in memory usage.
-paging is a method to avoid or minimize fragmentation.
-paging divides:
.physical memory into units called 'frames'
.logical memory (in cpu registers) into units called 'pages'
-the size of frames and pages are defined by the hardware and are in powers of 2 bytes. eg 512 bytes, 1 KB etc..
-frames and pages are usually same size.
-when a process requests data from disk, a frame is requested (from disk) and loaded as page (in memory).
-since the size of page=size of frame, the blocks fit exactly and there is no wastage of mem (ie fragmentation).
-a structure in the MMU called 'page table' keeps track of which frame is loaded as which page.
-note: MMU is a hardware device while page table is a logical construct within mmu.
-segmentation is another method of memory management.
-in segmentation, size of memory unit is not as important as content (as opposed to paging).
-in a way the segmentation is a users perspective of the memory.
-each segment is defined by a name and a length or offset.
-the segment name (by user) to physical address (in memory) is mapped in a 'segment table'.
-in certain computer architectures, both paging and segmentation can coexist.
-Intel architecture is an example where both the methods can coexist.
-on Intel arch, linux has 6 segments for kernel code, kernel data, user code, user data, tasks and a default.
-linux also has 3 level paging strategy for supporting other cpu archs.
... continued ...
-fragmentation - is a condition in which address spaces in memory are not contiguous.
-in other words, the address spaces are interspersed by blocks of memory that are unused.
-these blocks are unused as they are not sufficiently large to house address spaces belonging to any process.
-fragmentation causes inefficiency in memory usage.
-paging is a method to avoid or minimize fragmentation.
-paging divides:
.physical memory into units called 'frames'
.logical memory (in cpu registers) into units called 'pages'
-the size of frames and pages are defined by the hardware and are in powers of 2 bytes. eg 512 bytes, 1 KB etc..
-frames and pages are usually same size.
-when a process requests data from disk, a frame is requested (from disk) and loaded as page (in memory).
-since the size of page=size of frame, the blocks fit exactly and there is no wastage of mem (ie fragmentation).
-a structure in the MMU called 'page table' keeps track of which frame is loaded as which page.
-note: MMU is a hardware device while page table is a logical construct within mmu.
-segmentation is another method of memory management.
-in segmentation, size of memory unit is not as important as content (as opposed to paging).
-in a way the segmentation is a users perspective of the memory.
-each segment is defined by a name and a length or offset.
-the segment name (by user) to physical address (in memory) is mapped in a 'segment table'.
-in certain computer architectures, both paging and segmentation can coexist.
-Intel architecture is an example where both the methods can coexist.
-on Intel arch, linux has 6 segments for kernel code, kernel data, user code, user data, tasks and a default.
-linux also has 3 level paging strategy for supporting other cpu archs.
... continued ...
No comments:
Post a Comment