"Garbage Collection" probably sounds like a strange term if you've never heard of it before. So what is it? Well, you've all probably heard of a "memory leak" before. Garbage Collection, or GC, is essentially an attempt to prevent memory leaks. Back in the old days, developers had to be very diligent about cleaning up after themselves. If an object was allocated repeatedly but never "destroyed" or cleaned up the system would gradually use more and more memory until there was no more available memory and the application would crash.
The first graph shows memory consumption over time while the garbage collector is allowed to manage the memory.
The second graph shows the same thing while the program manages it's own memory by explicitly deleting the objects when it is done with them.
3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4: <html xmlns="http://www.w3.org/1999/xhtml">
5: <head id="Head1" runat="server">
6: <title>Untitled Page</title>
9: <form id="form1" runat="server">
11: <button onclick="cancel = false; useMemory(false);">
12: start (normal)</button>
13: <button onclick="cancel = false; useMemory(true);">
14: start (self cleanup)</button>
15: <button onclick="cancel = true;">
17: <br />
18: <input type="text" id="output" />