When iI use the top terminal program at linuxLinux, iI can't see the result of free.
My expectation isMy expectation is:
free map and list.
The memory usage that iI can see at the top(linuxLinux function) or /proc/meminfo
/proc/meminfoget smaller than past.sleep is start.
program exit.
But The usage of memory only getgets smaller when the program is endends.
Would you explain the logic of free function?
Below is my code.
for(mapIter = bufMap->begin(); mapIter != bufMap -> end();mapIter++) { list<buff> *buffList = mapIter->second; list<buff>::iterator listIter; for(listIter = buffList->begin(); listIter != buffList->end();listIter++) { free(listIter->argu1); free(listIter->argu2); free(listIter->argu3); } delete buffList; } delete bufMap; printf("Free Complete!\n"); sleep(10); printf("endend\n"); Thanks you.