Re: Memory leaks
- From: Havoc Pennington <hp redhat com>
- To: Enrico Fracasso <fracassoe yahoo com>
- Cc: gtk-list <gtk-list gnome org>, trog gtk org
- Subject: Re: Memory leaks
- Date: 19 Feb 2001 12:16:49 -0500
Enrico Fracasso <fracassoe yahoo com> writes:
> if i run it the memory used by the process increases (checked with top)
> if I remove the gtk_ctree_insert_node(...) and gtk_ctree_remove_node(...) lines the
> memory remain constant.
> According to you, where's the problem?
>
We really need this in the FAQ...
top is meaningless. top is meaningless. top is meaningless. ;-)
top indicates memory given to the process by the operating
system. Both GLib and the C library (malloc implementation) will cache
this memory on occasion, even if you free it with free. So you can't
use top to see if you are using free properly (aside from the very
roughest of estimations, i.e. if you are really, really screwing up
top will show that, but you can't distinguish small mistakes from the
GLib/malloc caches).
Anyway, I think you're just seeing the CTree nodes getting cached.
But maybe not.
BTW, that use of getcwd() is not portable according to the man page.
Havoc
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]