Question

Compare and contrast memory allocation and disk allocation.

Compare and contrast memory allocation and disk allocation.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Disk Allocation:

An important function of the file system is to manage space on the secondary storage, which includes keeping track of both disk blocks allocated to files and the free blocks available for allocation.

The main problems in allocating space to files are:

1. effective utilization of disk space

2. fast accessing of files

Management of disk blocks is a familiar problem that we have encountered and discussed in relation to main-memory management. But, secondary storage introduces two additional problems:

  • slows disk access time and
  • the larger number of blocks to deal with

In spite of that, many considerations are similar to both environments, particularly, contiguous and non-contiguous allocation of files. Three widely used allocation techniques are contiguous, linked and indexed. The last two belongs to non-contiguous allocation of files. Each method has its advantages and disadvantages.

While discussing those allocation strategies we will consider that a file is a sequence of blocks. All I/O operations on disk occur in term of blocks. The conversion from logical records to physical blocks is done by the software.

Memory allocation:

Memory allocation is the process of setting aside sections of memory in a program to be used to store variables, and instances of structures and classes. There are two basic types of memory allocation:

When you declare a variable or an instance of a structure or class. The memory for that object is allocated by the operating system. The name you declare for the object can then be used to access that block of memory.

When you use dynamic memory allocation you have the operating system designate a block of memory of the appropriate size while the program is running. This is done either with the new operator or with a call to the malloc function. The block of memory is allocated and a pointer to the block is returned. This is then stored in a pointer to the appropriate data type.

Add a comment
Know the answer?
Add Answer to:
Compare and contrast memory allocation and disk allocation.
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT