Итерация "Mem Usage" "VM Size"1000 48.3 MB 40.3 MB2000 48.5 MB 40.4 MB5000 48.4 MB 40.4 MB10000 48.3 MB 40.3 MB
Итерация "Mem Usage" "VM Size" (для всех 3-х тестов +/- 0.2 MB)1000 49.4 MB 41.3 MB2000 51.2 MB 43.2 MB5000 56.2 MB 48.1 MB10000 64.7 MB 56.6 MB
#ifndef WIN32_DEBUG_H#define WIN32_DEBUG_H#if(defined WIN32 && defined _DEBUG) #define WIN32_DEBUG #include <crtdbg.h> #define _CRTDBG_MAP_ALLOC // enable generation of debug heap alloc map #define new new( _NORMAL_BLOCK, __FILE__, __LINE__) // redefine "new" to get file names in output#endif #endif
...#ifndef WIN32_DEBUG_H #include "win32_debug.h"#endifint main(int argc, char *argv[]){ QApplication a(argc, argv);#ifdef WIN32_DEBUG _CrtMemState _ms; HANDLE hLogFile; hLogFile = CreateFile("../Debug/log/log_mem_leak.txt", GENERIC_WRITE, FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE); _CrtSetReportFile(_CRT_WARN, hLogFile); _CrtMemCheckpoint(&_ms); // now forget about objects created before#endif...// тело программы...#ifdef WIN32_DEBUG _CrtMemDumpAllObjectsSince(&_ms); // dump leaks CloseHandle(hLogFile);#endif return res;}
Dumping objects ->....\my_file.cpp(1691) : {37521} normal block at 0x015293A0, 4 bytes long. Data: <@ > 40 00 9F 03