My first ever experience with a garbage collector was something I wrote back in the early 80s on an oric 1 micro which was an early british 6502 micro. The program took a load of data points mapped to a grid and constructed a contour map, and printed the contours out on the oric mini-plotter. I was making a map of a large survey area and had 4 orics running in parallel, each one calculating the contour map for a different grid square, there were about 100 squares that needed contouring. I can't remember exact times now but each square took something like 5 minutes to produce a contour map for, which is why I was using multiple machines in parallel if I was ever to hope of getting the job done in any sort of reasonable time span. This was for a geophysical magnetometry survey. Anyway... I divided up the field data, stuck it on different casettes, and started the four machines running, doing their stuff and printing out the maps. I noticed something strange happening. Every ten minutes or so, one of the machines would stop printing dead in the middle of a map, and just sit there for about five minutes doing nothing, and then start up again. I knew it hadn't crashed, because you could hear a particular signature background digital noise on the buiilt-in speaker when it was running. I had no idea what was causing the hangs.
So I trawled through the books, magazines etc that I had lying around. I found out the basic interpreter had something called a garbage collector, and that every now and again when the interpreter had enough garbage to collect it would halt all other processing and sit there solely doing garbage collection. This was on a 2 MHz 6502 (or was it 1 MHz... can't remember) with 48 kbytes of RAM. It was as slow as hell. Reading a bit more, I learned that if I called a particular rom entry point I could force garbage collection to occur early rather than wait for the interpreter to decide it needed to be run. So I changed the code to force the garbage collector to run right after printing each individual map. And that stopped the 5-minute hangs from happening.
This was all so that the basic interpreter could support a model where the programmer didn't have to worry about memory management...