Re: [Vala] array memory leak?



Hi Bernhard,

On Thu, 2014-03-06 at 11:00 +0100, Ulink wrote:
//test 1: memory used by Dummy1 still used after return from Dummy1
//test 2: memory used by Dummy1 FREED after return from Dummy1. WTF?

You have to provide more details. What's your method of testing whether
memory used by Dummy1 has been freed or not? RSS is at 110 MB here
during the loop in either case.

glibc does not and cannot immediately return every freed block back to
the system. Some blocks cannot be freed because they are just gaps
between heap-allocated regions and some blocks are intentionally not
freed to speed up following allocations.

You can normally trust valgrind's output to check whether your
application or library has memory leaks. If you're interested in more
than that, you can look into tuning¹ glibc's malloc.

Regards,
Jürg

¹ http://www.gnu.org/software/libc/manual/html_node/Malloc-Tunable-Parameters.html



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]