[Bug 42216] New: The Contacts mixin wastes memory in duplicated strings

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Tue Oct 25 16:42:33 CEST 2011


https://bugs.freedesktop.org/show_bug.cgi?id=42216

             Bug #: 42216
           Summary: The Contacts mixin wastes memory in duplicated strings
    Classification: Unclassified
           Product: Telepathy
           Version: git master
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: tp-glib
        AssignedTo: telepathy-bugs at lists.freedesktop.org
        ReportedBy: alban.crequy at collabora.co.uk
         QAContact: telepathy-bugs at lists.freedesktop.org


Valgrind-massif shows the following usage of the heap in gabble:

->10.27% (643,386B) 0x47C0209: standard_malloc (gmem.c:88)
| ->10.26% (642,747B) 0x47C0750: g_malloc (gmem.c:164)
| | ->05.11% (320,171B) 0x47D88C9: g_strdup (gstrfuncs.c:102)
| | | ->01.74% (108,836B) 0x44660C2: tp_contacts_mixin_set_contact_attribute
(in /usr/lib/libtelepathy-glib.so.0.61.0)
| | | | ->00.38% (23,760B) 0x8135A65: conn_client_types_fill_contact_attributes
(conn-client-types.c:165)
| | | | | ->00.38% (23,760B) 0x4465D32:
tp_contacts_mixin_get_contact_attributes (in
/usr/lib/libtelepathy-glib.so.0.61.0)

In my tests, I have 330 contacts.

It means the string
"org.freedesktop.Telepathy.Connection.Interface.ClientTypes/client-types" uses
23kbytes of memory.

The string
"org.freedesktop.Telepathy.Connection.Interface.ContactCapabilities/capabilities"
also uses 23kbytes of memory.

In total, tp_contacts_mixin_set_contact_attribute() is responsible for
108kbytes of memory, most of it is just a few strings strdup'ed for each
contact.

Could GQuarks be used instead of duplicating strings?

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA Contact for the bug.
You are the assignee for the bug.



More information about the telepathy-bugs mailing list