I have a program that runs a specific task over several files, so effectively it has a structure as follow:
std::vector<string> fileList=getFileList();
for(int i=0;i<fileList.size();i++)
{
processFile(fileList[i]);
}
I am worried that there is a small memory leak in processFile function (this is relatively complex function which calls several other functions and uses several classes).
To check if I really have a memory leak in this function, like to measure the amount of memory that my application uses before and after the call to processFile and run it over a very large set of data and see how memory usage changes during processing.
Is there any way that I can measure the amount of memory that my application is using inside that application?
In the same way, can I find the amount of memory that each part of my application is using during run time?