[quote author="Meraj Ahmad Ansari" date="1307953504"]
Frankly speaking I never considered it as a question. I really want to know What type of technique other developers are using.[/quote]
As I think this is directly related to your last question I'll answer right here.
To me, there are usually two types of heap allocations in an application:
small, but frequent allocations required for the program to flow, like creating widgets or objects on the heap for the user interface or eg. network processing
large, but infrequent allocations required for some specific tasks and not necessarily required for the program to flow, like a buffer for loading eg. a large image into memory which has been selected by the user in an image processing application
The way you react to out of memory situations will differ for both types.
I see no way a program can or should recover from such situations. It should save any data which has to be saved to a persistent storage and then exit. For this task, you will usually need just a limited amount of information, which then has - of course - to be available to your new handler / exception handler. This allows you to handle out of memory situations at a single point in your code.
Usually the required information is available through your "design" anyways, because you'll need it for your normal program flow too (eg. Application::instance()->openedImage()->data() to stay at our image processing application example). There is no need to access all the other data not relevant for you recovery code, especially there is no need to delete anything because your application gets aborted anyways.
However, if you need to allocate further memory in your recovery code you should have reserved some already (the "emergency heap" discussed earlier).
There is no need to abort the application in such situations. Allocations failures can be caught using std::nothrow and a null pointer check or local exception handling.
Probably my last post was a bit misleading. Of course there are situations where it is absolutely legitimate to use a std::nothrow / null pointer check, but you should not guard every single allocation with it.