⇰ SEGMENTATION :-
In operating system segmentation is a memory management technique in which, the memory is divided into the variable size parts. Each part is known as segment which can be allocated to a process. Each segment is actually a different logical address space of the program. When a process want to be executed, its corresponding segmentation are loaded into non-contiguous memory, though every segment is loaded into a contiguous block of available memory.
Segmentation memory management technique is somehow works similar to the paging technique. But here difference is that the every segment is of different length where as in paging, pages are of fixed size or same size. A program segment contains the program's main function, utility functions, data structures, and many others.
The details about each segment are stored in a table called as segment table which is maintained by the operating system. The segment table contains segment numbers, their size and corresponding memory locations in main memory. For each segment, the table stores the starting address of the segment and the length of the segment. Segment table is stored in one or many of the segments. The segment table contains mainly two information :-
i> Base: It is the base address of the segment
Till now, we were using paging technique as our main memory management technique. Paging is more close to O/S rather than the users. It divides all the process into the form of pages regardless of the fact that a process can have some relative parts of the functions which needs to be loaded in the same page. The operating system never cares about the user's view of the process. It may divide the same function into different pages and those pages may or may not be loaded at the same time into the memory.
Paging technique can decrease the efficiency of the system. It is better to have segmentation which divides the process into the segments. Each segments contains same types of function, sach as main function can be included in one segment and library functions can be included in the other segment and so on.
⇰ ADVANTAGES :-
i] Less overhead on system.
ii] No Internal fragmentation.
ii] No Internal fragmentation.
iii] It is easier to relocate segments than entire address space.
iv] Segment Table consumes less space than Page table.
v] Average Segment Size is larger than the actual page size.
⇰ DISADVANTAGES :-
i] It is difficult to allocate contiguous memory to variable sized partition.
ii] It can suffer from external fragmentation.
iii] It is Costly memory management algorithms.
iv] The free memory space is broken into little pieces.
click here for Paging.
Share, Follow and please comment if you find anything incorrect or to share more information about the topic discussed above.
Comments
Post a Comment
Please comment.