I'm trying to optimize memory usage of a program and therefore wants to remove objects when they aren't needed any longer. To check if this works correctly I wrote a console.writeline method in the destructor of the type of object I want to remove. However when I test the program, no lines are written (only when the program terminates of course).
Is there a way to get a list of object, events,... That keep a certain object alive and prevent it from being eliminated by the garbage collector. Or is there a profiler, debugger that can do this (MonoDevelop-compatible if possible)?