I am building some instrumentation in to an application that is heavily threaded. We have been running in to various memory issues. One of the features I would like to add to the instrumentation is to track how much memory has been allocated per thread.
I've done some research and I can see where this can be done in unmanaged C++ code by wrapping the MALLOC function such as discussed here http://stackoverflow.com/questions/781118/per-thread-memory-allocation.
Is there any type of event I can subscribe to at the application level, or any other strategy that would give me some vision in to memory allocation (and maybe deallocation)?