Computer Science, asked by sonusuman4217, 1 year ago

Explain merits and demerits of static and dynamic memory allocation techniques

Answers

Answered by Anonymous
1

Answer:

Its not that static memory allocation is not used but its has many disadvantages or we can call them limitations :

  1. The scope and lifetime is limited
  2. Only when globally defined its scope is not bounded
  3. The amount of memory available through stack-based allocation is commonly far less than the amount of memory available through heap-based memory allocation.
  4. Once you move out of the system,the memory crashes that is a very big disadvantage.

Merits :

It has automatic cleanup and no manual assistance is required for this process.It is best used when the size is already know to you.

Dynamic Memory Allocation:

Its is performed during run time and is assigned to heap.The size may or may not be known in starting.There is no particular order of assignment.

Similar questions