Hi;

On 30 July 2016 at 14:58,  <jcup...@gmail.com> wrote:
> You need to set the malloc routines to use the real system malloc;
>
>         export G_DEBUG=gc-friendly
>         export G_SLICE=always-malloc

With recent (2 years old at least) versions of GLib,
`G_SLICE=always-malloc` is not necessary: GLib will detect if it's
running under Valgrind and will disable the slice allocator
automatically. It'll also mark regions in GObject that do tricks with
memory management, like the per-instance private data.

There's still a plan to make GLib more Valgrind friendly by having
"cleanup" sections that get run at the end of the process life time,
if the process is running under Valgrind, but it's not a trivial thing
to achieve because of the potential for re-entrancy and dependencies
between components.

Ciao,
 Emmanuele.

> On 28 July 2016 at 17:18, Norman Goldstein <norm...@telus.net> wrote:
>> I'd like to understand how to confirm a potential memory leak in gtk3.
>> Valgrind shows a definite leak, and "top" shows a steadily increasing
>> resident set size (RES).  However, as I have come to understand, due to how
>> gtk/glib uses slices for memory management, and how the main loop of gtk
>> plays a part, things are not as straightforward as I have just outlined.  Is
>> there a definitive guide, "How to confirm a memory leak in GTK"?  I have
>> only seen various relevant pages on the net.
>> _______________________________________________
>> gtk-app-devel-list mailing list
>> gtk-app-devel-list@gnome.org
>> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
> _______________________________________________
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list



-- 
https://www.bassi.io
[@] ebassi [@gmail.com]
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to