Skip to main content

Fragmentation Problem Always Occurs In The Memory

1.Fragmentation problem always occurs in the memory

Fragmentation

     As processes are loaded and removed from memory, the free memory space is broken into little pieces. It happens after sometimes that processes can not be allocated to memory blocks considering their small size and memory blocks remains unused.

This problem is known as Fragmentation.Memory fragmentation occurs when a system contains memory that is technically free but that the computer can’t utilize.

The memory allocator, which assigns needed memory to various tasks, divides and allocates memory blocks as they are required by programs; when data is deleted, more memory blocks are freed up in the system and added back to the pool of available memory.

When the allocator’s actions or the restoration of previously occupied memory segments leads to blocks or even bytes of memory that are too small or too isolated to be used by the memory pool, fragmentation has occurred. Fragmentation can take a significant bite out of a computer's free memory and it is often the cause of frustrating out-of-memory error messages.

Fragmentation is of two types:



S.N. Fragmentation Description
1 External fragmentation Total memory space is enough to satisfy a request or to reside a process in it, but it is not contiguous so it can not be used.
2 Internal fragmentation Memory block assigned to process is bigger. Some portion of memory is left unused as it can not be used by another process.



fragmentation types


External fragmentation can be reduced by compaction or shuffle memory contents to place all free memory together in one large block. To make compaction feasible, relocation should be dynamic.

Internal Fragmentation


     Internal fragmentation occurs when the memory allocator leaves extra space empty inside of a block of memory that has been allocated for a client. This usually happens because the processor’s design stipulates that memory must be cut into blocks of certain sizes -- for example, blocks may be required to be evenly be divided by four, eight or 16 bytes.

When this occurs, a client that needs 57 bytes of memory, for example, may be allocated a block that contains 60 bytes, or even 64. The extra bytes that the client doesn’t need go to waste, and over time these tiny chunks of unused memory can build up and create large quantities of memory that can’t be put to use by the allocator. Because all of these useless bytes are inside larger memory blocks, the fragmentation is considered internal.

External Fragmentation


     External fragmentation happens when the memory allocator leaves sections of unused memory blocks between portions of allocated memory. For example, if several memory blocks are allocated in a continuous line but one of the middle blocks in the line is freed (perhaps because the process that was using that block of memory stopped running), the free block is fragmented.

The block is still available for use by the allocator later if there’s a need for memory that fits in that block, but the block is now unusable for larger memory needs.

It cannot be lumped back in with the total free memory available to the system, as total memory must be contiguous for it to be useable for larger tasks. In this way, entire sections of free memory can end up isolated from the whole that are often too small for significant use, which creates an overall reduction of free memory that over time can lead to a lack of available memory for key tasks.

Fragmentation Can Mean Big Problems for Systems


     Fragmentation can become an issue because it builds up over time, creating small and useless blocks of memory and limiting the amount of a computer’s available free memory.

As it progresses, fragmentation can cause system performance to become slow and sluggish in the short term; in the long term, fragmentation can shorten the life of a computer or server by 30 percent on average. Of the two types of fragmentation, internal is more predictable than external because the amount of wasted space is determined by the memory allocator’s parameters (how big the allocated blocks must be), which is a constant.

In addition, the amount of overall memory lost to internal fragmentation is usually less than what’s lost to external fragmentation, although it can gradually accumulate. External fragmentation, on the other hand, is harder to predict because in most cases several processes are regularly starting and stopping in the system and blocks of memory that are used for varying lengths of time are freed up in a different order than they were filled, leaving gaps in the available memory.

Fighting Fragmentation for Improved Performance


     When it comes to optimizing RAM, the only useful solution is to reboot the system, which clears much of the memory in use by long-running programs and gives the computer a fresh start for allocating memory. Tools that claim to defrag RAM are misleading, as the virtual memory manager in modern computers works to optimize RAM usage constantly.

For your hard drive, however, some defragmenting may be required to maximize system performance. If you run Windows Vista or later versions, the system automatically defragments your hard drive space periodically for you.

If you notice slower system performance and want to run the defragmenter yourself, you can manually start the process by clicking "Start," then "All Programs | Accessories | System Tools | Disk Defragmenter." Finally, click "Defragment Now." The process could take anywhere from minutes to hours depending on how fragmented your hard disk is, but the good news is that you can use your computer while Disk Defragmenter is running.
 
     The problem of fragmentation does not apply to all operating systems equally. For Mac computers, defragmenting is not necessary because Mac OS X automatically optimizes disk space when files are written.

Linux machines also do not require regular defragmenting because they assign memory in a scattered format instead of a contiguous one, giving the files room to expand. Linux users who see a drop in system performance should consider increasing the size of their hard disk. Finally, you should never defragment a solid state storage drive (such as a USB drive), since defragmentation can actually shorten the usable life of solid state drives.

Paging


     External fragmentation is avoided by using paging technique. Paging is a technique in which physical memory is broken into blocks of the same size called pages (size is power of 2, between 512 bytes and 8192 bytes). When a process is to be executed, it's corresponding pages are loaded into any available memory frames.

Logical address space of a process can be non-contiguous and a process is allocated physical memory whenever the free memory frame is available. Operating system keeps track of all free frames. Operating system needs n free frames to run a program of size n pages.

Address generated by CPU is divided into

    Page number (p) -- page number is used as an index into a page table which contains base address of each page in physical memory.

    Page offset (d) -- page offset is combined with base address to define the physical memory address.
                                       Following figure show the paging table architecture.

Segmentation

     Segmentation is a technique to break memory into logical pieces where each piece represents a group of related information. For example ,data segments or code segment for each process, data segment for operating system and so on.

Segmentation can be implemented using or without using paging.Unlike paging, segment are having varying sizes and thus eliminates internal fragmentation. External fragmentation still exists but to lesser extent.


Comments

  1. windows 7 pro key , visual studio 2012 ultimate activation key , purchase windows 7 key , window 7 product key ultimate product key free download , Genuine Windows 10 Pro Online Key Sale , windows 7 keycodes cheap , free genuine windows 7 home premium product key , Office Home and Bussiness 2016 for Mac , l4BcXe

    cheap office project 2013 product keys

    buy windows 7 ultimate sp1 product key

    Online Windows 10 Pro Product Key Store

    Windows 7 Home Premium SP1 key code

    buy cheap windows 7 product keys

    ReplyDelete
  2. Really Liked the information you have provided. I have an article relaed to it. I was searching about it on the internet and I found an amazing site from Spoke Site. The provided Article was about a site that provides working modded android apps. The name of the site was “Fineapkapps”. The Article was very halpful, You should read that. Click Here to reach that amazing article: Fineapkapps.

    ReplyDelete

Post a Comment

Popular posts from this blog

2.1.4 Distinguish between logical I/O and physical I/O

2.1.4 Distinguish between logical I/O and physical I/O logical input relate to hard disk Logical I/O an Physical I/O Physical" I/O is an actual fetch of data from a storage device such as a disk. Logical" I/O is a programmatic request for data satisfied by a memory (block, buffer) access. A logical I/O may cause a physical I/O in the first place, or a logical I/O may retrieve a part of a block (buffer) of data from memory. 2.1.5 Distinguish between directory management and disk space management. Directory management A directory is a hierarchical collection of directories and files.  The only constraint on the number of files that can be contained in a single directory is the physical size of the disk on which the directory is located. Disk management A hard disk is a rigid disk inside a computer that stores and provides relatively quick access to large amounts of data. It is the type of storage most often used with Windows. The system also supp

3.1.1 Identify Between Resident And Transient Routines

Memory Management Memory management is concerned with managing: The computer’s available pool of memory Allocating space to application routines and making sure that they do not interfere with each other. 3.1.1 Identify between resident and transient routines The operating system is a collection of software routines. Resident routines Transient routines Routines that directly support application programs as they run Stored on disk and read into memory only when needed Example: routine that control physical I/O Example: routine that formats disks The operating system occupies low memory beginning with address 0. Key control information comes first followed by the various resident operating system routines. The remaining memory, called the transient area, is where application programs and transient operating system routines are loaded. Resident & transient routines structure

Operating Systems Definition and the Classification of OS

             OPERATING SYSTEMS ( OS ) What is an operating system? An operating system (sometimes abbreviated as "OS") is the program that, after being initially loaded into the computer by a boot program, manages all the other programs in a computer. The other programs are called applications or application programs. The application programs make use of the operating system by making requests for services through a defined application program interface (API). In addition, users can interact directly with the operating system through a user interface such as a command language or a graphical user interface (GUI). An operating system performs these services for applications:     In a multitasking operating system where multiple programs can be running at the same time, the operating system determines which applications should run in what order and how much time should be allowed for each application before giving another application a turn.     It manages the sharing of