@ anthonys - No, when you assigned the relays to a position within the device array their reference count increased to two. When you left ProgramStarted their reference count was reduced by one. Since their reference count was greater than zero, because of the reference within the device array they are not GC’s.
You could do it the way the desktop .NET does it, with a generational mark-and-sweep GC. This type of GC is known as a “tracing garbage collector”, and it’s the most common type, more common than simple reference counting. This type has the advantage that circular references don’t result in memory leaks.
Absolutely not. NETMF uses a simple mark-and-sweep GC (there are other approaches, like generational garbage collection). Unlike reference counting, true GC algorithms can also deal with cyclic data structures automatically.