what does garbage collected mean
i've heard of languages that are garbage collected. i think java is an
example. what does this mean |
its a method to reclaim memory, from unused objects.. more or less.
read this java has automatic collection, c++ might be manual... im not positive, i dont use c++, only java. |
C / C++ certainly do not have Garbage Collection.
Ass far as I know, it is to free up memory on the heap from unused objects. I think it also has something to do with pointers - If you dynamically allocate an array using malloc or calloc, you must remember to use free to release the memory. Java does have automatic garbage collection - when there are no references to any objects, Java knows that it can safely remove these from memory, and will do so when it feels like it. I hope this helps --Ian |
In C++ this function would cause a memory leak:
Code:
void memoryleak() |
All times are GMT -5. The time now is 04:56 AM. |