Allocation techniques, Operating System

Assignment Help:

Since most of the programs require a lot of memory allocation/deallocation, we expect the memory management to be fast, to have low fragmentation, make good use of locality, and be scalable to multiple processors. Newer issues include security from attacks (e.g. use randomization of locations to minimize effect of buffer-over?ow attacks) as well as reliability in the face of errors (e.g. detecting double free()'s and buffer overruns).

In analyzing the speed of an allocator, the key components are the cost of malloc, the cost of free, and the cost of getting the size of an object (for realloc). In certain types of programs, for instance those with a lot of graphics manipulation, allocators can become the performance bottleneck, and so speed is important.

We say that fragmentation occurs when the heap, due to characteristics of the allocation algorithm, gets "broken up" into several unusable spaces, or when the overall utilization of the memory is compromised. External fragmentation happens when there is waste of space outside (i.e. in between) allocated objects; internal fragmentation happens when there is waste of space inside an allocated area.

Remember that the allocator might at any single time have several pages with unused space, from which it could draw pieces of memory to give to requesting programs. There are several ways to decide what are the good spots, among those with free memory, from which to take memory. The ?rst-?t method ?nds the ?rst chunk of desired size and returns it; it is generally considered to be very fast; best-?t ?nds the chunk that wastes the least of space; and worst-?t takes memory from the largest existent spot, and as a consequence maximizes the free space available. As a general rule, ?rst-?t is faster, but increases fragmentation. One useful technique that can be applied with these methods is always to coalesce free adjacent objects into one big free object.


Related Discussions:- Allocation techniques

Evicting pages from physical memory, When do we write a page from physical ...

When do we write a page from physical memory back to the disk? In general, caches have two broad types of writing policies. One approach is a write-through cache. In this case,

Unsafe state, discuss unsafe state in operating system

discuss unsafe state in operating system

Basic server model, Suppose we want to program a Web server; we could easil...

Suppose we want to program a Web server; we could easily do so without using concurrency, as follows: while(true) wait connection read from socket and parse url look up url cont

What is process control block, What is process control block? Every pro...

What is process control block? Every process is represented in the OS by a process control block. It has many pieces of information associated with an exact process.

#title.Kernal, Ask questiWhat is dispatcheron #Minimum 100 words accepted#

Ask questiWhat is dispatcheron #Minimum 100 words accepted#

Mutual exclusion, With software algorithms for mutual exclusion, such as De...

With software algorithms for mutual exclusion, such as Dekker's algorithm, Peterson's algorithm, or Lamport's bakery algorithm, note that optimizing compilers and out-of-order exec

What is direct access, Normal 0 false false false EN-IN...

Normal 0 false false false EN-IN X-NONE X-NONE MicrosoftInternetExplorer4

What are the different methods for handling deadlocks?, What are the differ...

What are the different methods for handling deadlocks? Deadlock detection and recovery: Permit the system to enter a deadlock state, detect it and after that rec

What is a file path name, What is a file path name? A list of the subdi...

What is a file path name? A list of the subdirectories, directories, and files we must traverse to reach a file from the root directory.

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd