After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 523260 - Access to the memory profilers data
Access to the memory profilers data
Status: RESOLVED WONTFIX
Product: glib
Classification: Platform
Component: general
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2008-03-18 22:41 UTC by Björn Lindqvist
Modified: 2018-01-04 13:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch (4.00 KB, patch)
2010-08-26 17:15 UTC, Jon Nordby
none Details | Review

Description Björn Lindqvist 2008-03-18 22:41:14 UTC
When you use the memory profiler by calling g_mem_set_vtable (glib_mem_profiler_table), it will collect statistics about how many bytes have been allocated and freed. The only way to access that information is by dumping it on stdout with g_mem_profile (). 

I want programmatic access to that data. It could be as simple as one function g_mem_profiler_amount_allocated () that returns profile_allocs - profile_frees. If such a function existed, it would make writing test code that detects memory leaks much easier.
Comment 1 Jon Nordby 2010-08-26 17:15:35 UTC
Created attachment 168820 [details] [review]
Proposed patch
Comment 2 Jon Nordby 2010-09-01 17:39:41 UTC
I'd love to have this in glib 2.26, if possible. If anything needs to be corrected/improved please let me know.
Comment 3 Philip Withnall 2018-01-04 13:27:50 UTC
g_mem_set_vtable() and g_mem_profiler_table have been deprecated since GLib 2.46, so this isn’t going to be supported. Use other (external) profiling tools instead.