I would like to write the following code in c#.
a) small console application that simulates memory leak.
b) small console application that would invoke the above application and
Just Create IDisposable objects and don't dispose them! Examples being ImageGraphics or any kind of handle or code that branches out into unmanaged code to create/manage resources.