Welcome to my presentation

16
WELCOME TO MY PRESENTATION TOPIC ON FRAGMENTATION (MEMORY MANAGEMENT) SUBMITTED TO MR. SARVESH SIR SUBMITTED BY ASHISH SINGH MCA III RD SEM UNITED COLLEGE OF ENGINEERING & RESEARCH GR. NOIDA

Transcript of Welcome to my presentation

WELCOME TO MY PRESENTATION

TOPIC ONFRAGMENTATION

(MEMORY MANAGEMENT)

SUBMITTED TO

MR. SARVESH SIR

SUBMITTED BY

ASHISH SINGH

MCA IIIRD SEM

UNITED COLLEGE OF ENGINEERING & RESEARCH GR. NOIDA

FRAGMENTATION

Orally presentation

Types

Causes of Fragmentation

Mathematically Presentation

Practical Presentation

Definition of Fragmentation

• Fragmentation occurs when a piece of data in memory is broken up into many pieces that are not close together.

• For example, files in a file system are usually managed in units called blocks or clusters. When a file system is created, there is free space to store file blocks together contiguously. This allows for rapid sequential file reads and writes.

• However, as files are added, removed, and changed in size, the free space becomes externally fragmented, leaving only small holes in which to place new data. When a new file is written, or when an existing file is extended, the new data blocks are necessarily scattered, slowing access due to seek time and rotational delay of the read/write head, and incurring additional overhead to manage additional locations. This is called file System fragmentation.

Orally Presentation

TYPES OF FRAGMENTATION

There are two types of Fragmentation. These are given below

• Internal Fragmentation

• External Fragmentation

Internal fragmentation occurs when storage is allocated without ever intending to use it. This space is wasted. While this seems foolish, it is often accepted in return for increased efficiency or simplicity. The term "internal" refers to the fact that the unusable storage is inside the allocated region but is not being used.

INTERNAL FRAGMENTATION

External Fragmentation

External fragmentation is the phenomenon in which free storage becomes divided into many small pieces over time. It is a weaknessof certain storage allocation algorithms, occurring when an application allocates and deallocates ("frees") regions of storage of varying sizes, and the allocation algorithm responds by leaving the allocated and deallocated regions interspersed. The result is that although free storage is available, it is effectively unusable because it is divided into pieces that are too small to satisfy the demands of the application. The term "external" refers to the fact that the unusable storage is outside the allocated regions.

Causes of Fragmentation

• Fragmentation occurs when the operating system cannot or will not allocate enough contiguous space to store a complete file as a unit, but instead puts parts of it in gaps between other files (usually those gaps exist because they formerly held a file that the operating system has subsequently deleted or because the operating system allocated excess space for the file in the first place). Larger files and greater numbers of files also contribute to fragmentation and consequent performance loss. Defragmentation attempts to alleviate these problems.

Mathematically presentation

Consider the following scenario, as shown by the image on the right:An otherwise blank disk has 5 files, A, B, C, D and E each using 10 blocks of space (for this section, a block is an allocation unit of that system, it could be 1K, 100K or 1 megabyte and is not any specific size). On a blank disk, all of these files will be allocated one after the other. (Example (1) on the image.) If file B is deleted, there are two options, leave the space for B empty and use it again later, or move all the files after B so that the empty space is at the end. This could be time consuming if there were hundreds or thousands of files which needed to be moved, so in general the empty space is simply left there, marked in a table as available for later use, then used again as needed. (Example (2) on the image.) Now, if a new file, F, is allocated 7 blocks of space, it can be placed into the first 7 blocks of the space formerly holding the file B and the 3 blocks following it will remain available.

(Example (3) on the image.) If another new file, G is added, and needs only three blocks, it could then occupy the space after F and before C. (Example (4) on the image). Now, if subsequently F needs to be expanded, since the space immediately following it is no longer available, there are two options: (1) add a new block somewhere else and indicate that F has a second extent, or (2) move the file F to someplace else where it can be created as one contiguous file of the new, larger size. The latter operation may not be possible as the file may be larger than any one contiguous space available, or the file conceivably could be so large the operation would take an undesirably long period of time, thus the usual practice is simply to create an extent somewhere else and chain the new extent onto the old one. (Example (5) on the image.) Repeat this practice hundreds or thousands of times and eventually the file system has many free segments in many places and many files may be spread over many extents. If, as a result of free space fragmentation, a newly created file (or a file which has been extended) has to be placed in a large number of extents, access time for that file (or for all files) may become excessively long.

PRACTICAL PRESENTATION

BASED ON

WINDOWS XP

After that these block spaces (red spaces) are free to use and our memory is defragmented.

Thank you