Presentation21

Presentation21 - – Implicit Memory Management – Use...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Memory Allocation
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Dynamic Memory Allocation Why do we need dynamic memory allocation? We do not know how the program will be used and the memory requirements of the program until it is used. We could define variables statically using a maximum limit but: If the use of the program exceeds limit we need to modify program. Also this wastes memory. With dynamic memory allocation the program calls malloc/new to allocate more memory. To free memory there are two approaches: Explicit Memory Management – call free/delete (C/C++/Pascal)
Background image of page 2
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: – Implicit Memory Management – Use Garbage collection (Java, C#, Perl, Python, Smalltalk) Implicit Memory Management • The language runtime provides a Garbage Collector (GC) that determines what objects are no longer in use and frees them. – Language runtime- Library that the provides common language functionality to a program. • There are two approaches: – Reference Counting – Mark and Sweep...
View Full Document

{[ snackBarMessage ]}

Page1 / 3

Presentation21 - – Implicit Memory Management – Use...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online