When closing the project (by using "close workspace"), the 50% of the memory used is returned. The same behavior happen without code completion, only that the used memory is much less.
This is
normal behaviour. About 50% of the memory belongs to block allocated objects, these are never freed. Thus it always looks like there is a massive leak at first glance.
You cannot find out about memory leaks as simple as this (see my above post with the memory diagram). If you want to detect a memory leak by observing the total memory consumption, then you have to open/close the same project many times (10-20 times) as tiwag did.
If there are
no memory leaks, you will still see that only 50% of the memory is freed, but if there
is a leak (as it is the case), 50% of the peak will be freed every time, but the
base will grow linearly.
Other options would be to
a) Compile wxWidgets in debug mode and run Code::Blocks from console. This will detect leaks of non-blockallocated objects.
b) Recompile Code::Blocks using the block allocator in debug mode. This will detect leaks of blockallocated objects. To do this, pass a positive integer as an additional template parameter to the classes which you want to observe:
class Token : public BlockAllocated<Token, 10000>becomes
class Token : public BlockAllocated<Token, 10000, 1>c) Use valgrind, but it is a lot easier to recompile wxWidgets in debug mode