Presentation21 - Implicit Memory Management Use Garbage...

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 DocumentRight 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

This note was uploaded on 01/30/2012 for the course CS 354 taught by Professor Staff during the Fall '08 term at Purdue University-West Lafayette.

Page1 / 3

Presentation21 - Implicit Memory Management Use Garbage...

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