Project

General

Profile

Howtos - Monitor memory leaks » History » Version 4

Greg Burri, 04/05/2011 02:39 PM

1 1 Greg Burri
h1. Howtos - Monitor memory leaks
2
3 4 Greg Burri
# Uncomment @# DEFINES += ENABLE_NVWA@ in @application/Core/Core.pro@ to activate monitoring.
4 3 Greg Burri
# Rebuild the _Core_.
5
# Run with the debugger attached (@F5@).
6 1 Greg Burri
# When you want to check the memory leaks type @quit@ in the console.
7
8
The output should be like this:
9
10
<pre>
11
quit
12
Leaked object at 028E3D30 (size 24, 00418418)
13
Leaked object at 028E5B60 (size 24, 004183CC)
14
Leaked object at 028E6148 (size 24, 004183CC)
15
Leaked object at 028E9B08 (size 24, 004183CC)
16
Leaked object at 028E8F98 (size 24, 00418418)
17
Leaked object at 028E6798 (size 24, 00418418)
18
Leaked object at 028E9078 (size 24, 00418418)
19
Leaked object at 028E9630 (size 14, /mingw/src/gccbf/mingw32/libstdc++-v3/include/bits/basic_string.tcc:587)
20
Leaked object at 028E6F00 (size 24, 00418418)
21
Leaked object at 028E6F70 (size 24, 00418418)
22
Leaked object at 028E6FE0 (size 24, 00418418)
23
Leaked object at 028E7BE0 (size 48, 0041D57E)
24
Leaked object at 028E7C68 (size 48, 0041D692)
25
Leaked object at 028E7CF0 (size 48, 0041D692)
26
Leaked object at 028E7D78 (size 48, 0041D636)
27
Leaked object at 028E7E00 (size 48, 0041D5DA)
28
Leaked object at 028E6400 (size 24, 00418418)
29
Leaked object at 028EE788 (size 24, 00418418)
30
Leaked object at 028EE7F8 (size 24, /mingw/src/gccbf/mingw32/libstdc++-v3/include/bits/basic_string.tcc:587)
31
Leaked object at 028EE868 (size 40, E:\projects\D-LAN\application\Core/main.cpp:43)
32
Leaked object at 028EB400 (size 8, E:\projects\D-LAN\application\Core/../Libs/qtservice/src/qtservice.h:183)
33
*** 21 leaks found
34
delete: freed 028EE7F8 (size 24, 590 bytes still allocated)
35
delete: freed 028EE788 (size 24, 566 bytes still allocated)
36
delete: freed 028E6148 (size 24, 542 bytes still allocated)
37
delete: freed 028E6400 (size 24, 518 bytes still allocated)
38
delete: freed 028E9B08 (size 24, 494 bytes still allocated)
39
delete: freed 028E5B60 (size 24, 470 bytes still allocated)
40
delete: freed 028E7E00 (size 48, 422 bytes still allocated)
41
delete: freed 028E7D78 (size 48, 374 bytes still allocated)
42
delete: freed 028E7CF0 (size 48, 326 bytes still allocated)
43
delete: freed 028E7C68 (size 48, 278 bytes still allocated)
44
delete: freed 028E7BE0 (size 48, 230 bytes still allocated)
45
delete: freed 028E6FE0 (size 24, 206 bytes still allocated)
46
delete: freed 028E6F70 (size 24, 182 bytes still allocated)
47
delete: freed 028E6F00 (size 24, 158 bytes still allocated)
48
delete: freed 028E9630 (size 14, 144 bytes still allocated)
49
delete: freed 028E9078 (size 24, 120 bytes still allocated)
50
delete: freed 028E6798 (size 24, 96 bytes still allocated)
51
delete: freed 028E8F98 (size 24, 72 bytes still allocated)
52
delete: freed 028E3D30 (size 24, 48 bytes still allocated)
53
Press <RETURN> to close this window...
54
</pre>
55
56 3 Greg Burri
For some leaks the file and the line are not displayed because the code doesn't contain any debug information, a lot of the leaks shown below come from static variables from the _Protocol Buffer_ library. The leak from @main.cpp:43@ is just a test, this line has been added: @int* test = new int[10];@