answersLogoWhite

0


Best Answer

MEMORY ALLOCATION MODELS……

STATIC MEMORY ALLOCATION DYNAMIC MEMORY ALLOCATION

Memory is allocated before the execution of the program begins.

(During Compilation)

Memory is allocated during the execution of the program.

No memory allocation or deallocation actions are performed during Execution.

Memory Bindings are established and destroyed during the Execution.

Variables remain permanently allocated.

Allocated only when program unit is active.

Implemented using stacks and heaps.

Implemented using data segments.

Pointer is needed to accessing variables.

No need of Dynamically allocated pointers.

Faster execution than Dynamic.

Slower execution than static.

More memory Space required.

Less Memory space required.

User Avatar

Wiki User

13y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

Static allocation mean that if you create an object of this type it will exists all life of your program without an option using that chunk of memory of something else.
When you are using dynamic allocation, you object can destroyed at virtually any moment and that memory can be reused for something else.

Static method is easier to use but it does not give flexibility.

Dynamic method is much harder to use and manage, but it gives a lot of flexibility and allows to use memory more efficiently.

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

As to physical memory:

  • Static memory will store its data as long as power is available. It is commonly used with a battery to retain small amounts of data when the main power to the computer is off.
  • Dynamic memory requires not only power but active refresh cycles that read and write back internally every row of data bits periodically. A Dynamic memory cell is much smaller and cheaper than a Static memory cell, so it is used for the main memory.
  • Non-volatile memory (e.g. magnetic core memory, FLASH) will retain data even without power.

As to memory allocation in a program:

  • Statically allocated memory is allocated once when the program enters and is not deallocated until the program exits.
  • Dynamically allocated memory is allocated on demand when the program needs it, and can be deallocated later when the program no longer needs it.
This answer is:
User Avatar

User Avatar

Wiki User

9y ago

Static memory is pre determined memory and has a fixed value in it ,while dynamic memory is allocated at run time by depending on the resources used.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What do you understand by static memory allocation and dynamic memory allocation?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What are types of memory allocation?

There are two types of memory allocations. 1. Static memory allocation 2. Dynamic memory allocation


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

Static Memory Allocation: Allocating the total memory requirements that a data structure might need all at once without regard for the actual amount needed at execution time. Dynamic Memory Allocation: The opposite strategy of static memory allocation - Dynamic Memory Allocation, involves allocating memory as-needed.


What is difference in static and dynamic storage allocation?

Static storage allocation is when a program dedicates an amount of memory for its use at the start of the program. Dynamic storage allocation is when a program only takes storage as it needs it.


At what time the memory is allocated for variable in c and c?

Static memory allocation occurs at compile time where as dynamic memory allocation occurs at run time.


What is the opposite of dynamic allocation?

The opposite of dynamic is static.


Differentiate between static allocation and dynamic allocation?

BS Anwer- static allocation is when something is moved to a location permanantally and dynamic allocation is when something is moved temporarily, but will move again.


What are the two methods of representing a binary tree?

Two method of representing a binary tree is Static allocation, and Dynamic allocation


Difference between dynamic and static memory?

dynamic is the study of motin,while static is at rest it means that the memory which is used at motin time as by usic calloc,mallaoc,free function ,on the other hand static is the memory which only used at compile time or at the time of work in during progrmming,static memory has drawback ,the drawback is that in this memory ware unable to use the excess memory as we allocate already to cover or improvre this type of problem we use dynamic memory allocation.


Why main memory use dynamic memory rather than static memory?

Dynamic memory changes and static stays the same.


Difference between dynamic and static memory allocation?

Static memory allocation is memory allocated on the "stack" and cannot be resized after the initial allocation, while dynamic memory allocation is memory allocated in the "heap", and can be dynamically expanded and shrunk as necessary.


What is dynamic mamory?

Dynamic memory refers to memory that is allocated and deallocated during program execution, as opposed to static memory which is allocated at compile time. In C and C++, dynamic memory allocation is done using functions like malloc() and free(), allowing for flexibility in managing memory resources at runtime. However, improper use of dynamic memory can lead to memory leaks or segmentation faults.


What is static and dynamic memory?

A computer is built to contain two kinds of memory. There is static memory, which stays in the computer after it is powered off. Then there is dynamic memory, which is memory that is only accessible while the computer is on. The hard drive is an example of static memory, while RAM is an example of dynamic memory.