Describe the Buddy system of memory allocation.

Answer Posted / wiki addict

The buddy memory allocation technique allocates memory in
powers of 2, i.e 2x, where x is an integer. Thus, the
programmer has to decide on, or to write code to obtain, the
upper limit of x. For instance, if the system had 2000K of
physical memory, the upper limit on x would be 10, since 210
(1024K) is the biggest allocatable block. This results in
making it impossible to allocate everything in as a single
chunk; the remaining 976K of memory would have to be taken
in smaller blocks.
After deciding on the upper limit (let's call the upper
limit u), the programmer has to decide on the lower limit,
i.e. the smallest memory block that can be allocated. This
lower limit is necessary so that the overhead of storing
used and free memory locations is minimized. If this lower
limit did not exist, and many programs request small blocks
of memory like 1K or 2K, the system would waste a lot of
space trying to remember which blocks are allocated and
unallocated. Typically this number would be a moderate
number (like 2, so that memory is allocated in 2² = 4K
blocks), small enough to minimize wasted space, but large
enough to avoid excessive overhead. Let's call this lower
limit l.
Now that we have our limits, let us see what happens when a
program makes requests for memory. Let's say in this system,
l = 6, which results in blocks 26 = 64K in size, and u = 10,
which results in a largest possible allocatable block, 210 =
1024K in size. The following shows a possible state of the
system after various memory requests.

Is This Answer Correct ?    5 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Define a good platform along with its qualities.

692


How is the total memory on a ram stick calculated?

607


What are the 4 major types of operating system?

561


How many bit is my computer?

535


What kind of operations are possible on a semaphore?

571






How do I cancel chkdsk scan?

602


Explain what is meant by CORE DUMPS?

595


What are the functions of the ram ic`s?

566


What are advantages of operating system?

532


What are the different operating systems?

618


Some omeone on campus calls and says they have a new Mac. They've just pulled it out of the box and want to plug it into the campus network. What might they need to set to make this work?

662


Why is it that a single, all – encompassing metric cannot be developed for programme complexity or programme quality?

1639


Explain a system in safe state?

567


Does dual boot affect performance?

528


Tell me something about the concept of memory leak?

595