Garbage Collector and Generic List

did a whole bunch of tests and watched the profiler like a hawk but couldn’t see any evidence that List actually generates any garbage at all, even if it’s a list of classes which are added, removed and sometimes the list is cleared.

Anyone have different findings, or is this a case where the ram usage will grow as the list grows, but nothing will be freed unless I null the list?

The best documentation is the source I guess, you can find it here: https://github.com/mono/mono/blob/master/mcs/class/corlib/System.Collections.Generic/List.cs

There is a function TrimExcess that will free memory it seems, but doesn’t seem to be called at remove, and must be called explicitly.