The realloc question reminded me to ask about this. If memory is allocated/reallocated/freed many times (thousands) over, does the program's memory usage keep growing due to leftover garbage, or does the C runtime or operating system take care of it?

Take the case of a program which compresses lines of text in memory, and decompresses/recompresses lines whenever changes are made (the benefit being memory savings, at the cost of speed.) Assuming garbage collection is automatic, how does it affect the performance of such programs?

-Joe