Interestingly, perhaps your thinking considers the methodology to be corrupted.
The main answer to your question is how to find out where this error occurs. - an answer has already been given; you know what that means.
However, this is one of those cases where a startup error is not a problem - of course, this 232-byte object is not your problem at all. These are the 20+ Megs that were allocated before it.
Several ideas have been posted to help you keep track of this; you really need to look at a "higher level" here in the application architecture, not just the individual functions.
Perhaps your application requires more memory to do what it does with custom loading. Or it may happen that there are some real memory bots that are not needed - but you must know what is necessary or not to answer this question.
Basically, this means that you need to take turns, by object, to profile as needed until you find what you are looking for; large memory users. Note that there cannot be one or two large objects ... if it were that simple! Once you find memory pigs, you need to find out if they can be optimized. If not, you will need more memory.
Andrew Barber
source share