I am writing some guidelines for the company and I need to answer some tough questions. This one is quite difficult.
The solution can be:
Not track at all. Make sure that objects are allocated using new which will throws an exception when allocation failed. The application will die, and it is not a big deal. PRO - code usually can be very clean.
Track memory allocation failures and reports it accordingly, just like any errors (such as file access error).
Honestly, I have to write much more code if we go with option 2. For example, many std::tring operations involve memory allocation. Such as
std::string str1, str2; str1 = str2; str += str2;
Our software will always run major platforms, not embedded. Somehow I think that option 1 is the way to go. What's your opinion?