Search your Topic HERE....

January 31, 2014

Dynamic Memory Allocation

6 comments

sponsored links

Friends, the Static Memory Allocation is good. But its not so useful for managing memory within a process, or for the management of process memory in an Operating System. The reason behind this is, we can not predict the sizes of processes.  So, we have to dynamically divide the memory into blocks in response to the requests that come.


Dynamic Memory Allocation is a classic problem in computer science. It is task of some complexity, but it is much studied and the techniques are well understood.

The allocator has to keep track of the allocated and free blocks. When a process requests a block of memory, the allocator picks one of the free blocks, gives the process all or part of it, and then records what it did. If it only allocated part of the free block, it divides the block into an allocated block and a free block. When a process finishes, it returns the block of memory to the allocator, which adds it to its set of free block available for allocation.

The below figures shows the allocation of a block and the freeing of a block.

Allocation and Freeing of a Block
There are two key decisions in the design of a memory allocator. Those are,
  1. How do we keep track of the blocks, and 
  2. Which block do we allocate, from when a request comes in.
An important issue in Dynamic Memory Allocation is called fragmentation, i.e., memory becoming divided-up into so many blocks that none of them are useful because they are all too small to satisfy any pending request. One simple precaution is to ensure that there are never two free blocks right next to each other. If this happens, the allocator will combine them into one bigger free block. The method we use to keep track of the blocks, is usually responsible for doing this. Even doing this, there might still be lots of small blocks between the allocated blocks.

That's all for now friends. In our next post we shall discuss another important topic for IBPS IT Officers exam. Happy Reading :)

Sai Spandana. Kotturi


 
sponsored links

6 comments:

  1. po reault jaldi aa ja....

    ReplyDelete
  2. when po3 results declare?

    ReplyDelete
  3. thats nice...pls upload the next topic soon with some possible mcq s with answers for scale-2 IT officer..

    ReplyDelete
  4. Since IBPS haven't mentioned anything about the dates regarding the combined Result of Common Interview, I think this time there will be direct allotment only.........

    ReplyDelete
  5. I think in the diagram it should be allocate P4..

    ReplyDelete
  6. What will be approx number of vacanies in po/mt iii

    ReplyDelete

Related Posts Plugin for WordPress, Blogger...