Hi. 2010/10/7 MÃrcio Ricardo Pivello <pivello@xxxxxxxxx>: > Hi all. > I use a library called GTS for computational geometry tasks, and it is > heavily based on GLib data structures. Specifically, in _many_ occasions it > returns a GSList* containing vertices, edges and so on, which you use and > then delete with g_slist_free( ). In my work, during a transient simulation > this kind of operation occurs at least tens of millions of times. Since > g_slist_free( ) does not actually deallocates the memory used by the list, > my program always ends consuming all available memory during the simulation > (8 GB, when it should use just 10% of that). I don't think g_slist_free() is problematic here. My guess would be that you're not freeing your data that is pointed to by list elements. g_slist_free() will only free memory that is used by GSList structs, data that is pointed to by data member of GSList structure needs to be freed separately. For example, take gtk_icon_view_get_selected_items() func. Usual usage is: GSList *items = gtk_icon_view_get_selected_items (icon_view); /* Do something here */ g_slist_foreach (items, (GFunc)gtk_tree_path_free, NULL); g_slist_free (items); The important line is g_slist_foreach() line, where actual data that is pointed to by nodes is freed. Tadej -- Tadej BorovÅak tadeboro.blogspot.com tadeboro@xxxxxxxxx tadej.borovsak@xxxxxxxxx _______________________________________________ gtk-list mailing list gtk-list@xxxxxxxxx http://mail.gnome.org/mailman/listinfo/gtk-list