Compare and contrast dynamic memory allocation and the allocation of files in secondary storage

 Dynamic Memory Allocation:

Memory allocation done at the time of execution(run time) is known as dynamic memory allocation. Functions calloc() and malloc() support allocating dynamic memory. The Dynamic allocation of memory space is allocated by using these functions when the value is returned by functions and assigned to pointer variables. In the Dynamic memory allocation, variables get allocated only if your program unit gets active. It is more efficient and it also uses heap for managing the dynamic allocation of memory. Memory size can be changed after allocation.

A file is a named collection of related information, usually as a sequence of bytes, with two views:

  • Logical (programmer’s) view, as the users see it.
  • Physical (operating system) view, as it actually resides on secondary storage.

As (integral or separate) part of an operating system, the file system manages this information on secondary storage. Uses of secondary storage include storing various forms of programs (source, object, executable) and temporary storage of virtual memory pages (paging device or swap space). Information in secondary storage may be in a variety of forms, including readable text and raw data (e.g., binary).

Each file is associated with a collection of information, known as attributes:

  • NAME, owner, creator
  • type (e.g., source, data, binary)
  • location (e.g., I­node or disk address)
  • organization (e.g., sequential)
  • access permissions
  • time and date (creation, modification, and last accessed)
  • size
  • variety of other (e.g., maintenance) information.

Comments

Popular posts from this blog

Create and outline the timeline of History of Operating Systems.