Free Republic
Browse · Search
General/Chat
Topics · Post Article

To: C19fan

The funniest thing I remember about them was what is termed now as garbage collection.

If you were creating, resizing or deleting arrays you had to be sure to run the garbage collector your you would run out of memory fast. Even re-assigning variable values used up space so you always had to reclaim it.


25 posted on 05/29/2014 7:48:45 AM PDT by ImJustAnotherOkie (zerogottago)
[ Post Reply | Private Reply | To 1 | View Replies ]


To: ImJustAnotherOkie

Most “popular” computer languages use garbage collector algorithms. Without garbage collection, a language REQUIRES the programmer to deallocate every variable they allocate.

Hence the popular languages of today are dumbed-down, as any real programmer will always deallocate what they allocate.

If something is allocated but not deallocated, and the program stop using the thing and thus effectively loses track of it, that is called a “memory leak”. It is memory that the program allocated but can’t use any more. With enough memory “leakage”, a program can be a huge drain on system memory.

In an effort to “help” idiots who were bad progammers, “garbage collection” was introduced as a language feature. The language runtime library will try to detect these situations and then do the deallocation for memory that can no longer be accessed. Once the memory is deallocated, it can be reused, i.e., used to satisfy another allocation. Determining whether memory is no longer in use by a program can be tricky, however, since if the garbage collector deallocates something that IS referenced again the program will produce an error when the deallocated memory is referenced.


29 posted on 05/29/2014 10:26:06 AM PDT by PieterCasparzen (We have to fix things ourselves)
[ Post Reply | Private Reply | To 25 | View Replies ]

Free Republic
Browse · Search
General/Chat
Topics · Post Article


FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson