I would like to write a utility class that will help me determine how much garbage a certain piece of code is making.
Something I can use like this:
GarbageProfiler.Start();
and int numGarbage = GarbageProfiler.End();
Idea is simple enough. But does it make sense to do so? Are there any tools out there to do just this?
But does it make sense to do so?
No.
You would at least have to differentiate between the Generations of the garbage.
The memory that a certain piece of code allocates and still holds at the end is (can be) much more expensive than the objects it quickly released.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With