Garbage Collection: Algorithms for Automatic Dynamic Memory Management by Rafael D Lins, Richard Jones

Garbage Collection: Algorithms for Automatic Dynamic Memory Management



Download eBook




Garbage Collection: Algorithms for Automatic Dynamic Memory Management Rafael D Lins, Richard Jones ebook
Page: 203
Format: pdf
Publisher: Wiley
ISBN: 0471941484, 9780471941484


Garbage Collection in computer science is a form of automatic memory management. Their very existence tells me . The access of automatic variables is a very fast assisted by hardware, so there is no loss of efficiency there. Dynamic memory allocation (Java-style) is done with malloc / calloc / realloc in C. The problem with garbage collection is that it solves only a subset of the overall problem set of dynamic resource management. If memory is freed automatically, the programmer loses at least some control over programs' resource usage. There is no actual allocation or deallocation going on: the space in the automatic memory (AKA "on the stack") is allocated by some compile-time bookkeeping around the stack pointer. Thankfully, modern languages with automatic garbage collection avoid this problem (by pretending it doesn't exist). A less than perfectly C++ smart pointers offer the possibility of a similar level of dynamic-memory safety as garbage collection, but with a different set of performance tradeoffs. These are not garbage collected - you need to explicitly free every pointer that you allocated. Free download ebook Garbage Collection: Algorithms for Automatic Dynamic Memory Management pdf.