really freeing the memory allocated by g_slist



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 read in some mailing list that setting the G_SLICE environment variable to always-malloc should work, but it didn't change anything. How can I solve this problem? 

PS: To setup G_SLICE I just defined it in my .bashrc file, like this:
G_SLICE=always-malloc; export G_SLICE;
Is it just it?

Thanks in advance

Márcio
--
Márcio Ricardo Pivello
Universidade Federal de Uberlândia
Faculdade de Engenharia Mecânica
Laboratório de Mecânica dos Fluidos
+55 (34) 3239 4040 ramal 618


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