I have just resolved a memory leak in my application and now I want to write a unit test to ensure that this does not happen again.
I\'m look for a way to detect th
That is not a unit test. If you want to make sure some unit that is supposed to manage a resource does not leak that resource then you need to validate that the resource it is managing gets deleted at the correct times. You can do this with mock objects which increment a counter on construction and decrement on delete...then make sure the count is right.
A test that checks the memory usage of an entire application is not something for a unit test. Unit tests are for particular units within the application.