Aaron Stone wrote:
> Here are the two killers, 300K is pretty bad, 71M is dangerous!
> 
> CC'ing to the dbmail-dev list, as we should probably keep the deep
> debugging noise off the general list.
> 
> Thanks for these valgrind logs and the test script!
> 
> Aaron
> 
> ==1631== 303,136 bytes in 1,212 blocks are possibly lost in loss record
> 25 of 26
> ==1631==    at 0x40226DB: memalign (vg_replace_malloc.c:332)
> ==1631==    by 0x4022735: posix_memalign (vg_replace_malloc.c:425)
> ==1631==    by 0x415E0A3: (within /usr/lib/libglib-2.0.so.0.1200.12)
> ==1631==    by 0x415EAC7: g_slice_alloc
> (in /usr/lib/libglib-2.0.so.0.1200.12)
> ==1631==    by 0x4145725: g_list_prepend
> (in /usr/lib/libglib-2.0.so.0.1200.12)
> ==1631==    by 0x41D6F4A: traverse_tree_keys (misc.c:1114)
> ==1631==    by 0x4168E44: g_tree_foreach
> (in /usr/lib/libglib-2.0.so.0.1200.12)
> ==1631==    by 0x41D6B04: g_tree_keys (misc.c:1127)
> ==1631==    by 0x41C41AA: dbmail_mailbox_get_set (dbmail-mailbox.c:1332)
> ==1631==    by 0x804EC61: _ic_fetch (imapcommands.c:1413)
> ==1631==    by 0x804F1A3: _ic_uid (imapcommands.c:1792)
> ==1631==    by 0x804D0DF: IMAPClientHandler (imap4.c:290)
> ==1631== 
> ==1631== 

I'm not sure how to read this. Is this something worth digging into? I
don't see how we could leak there.

> ==1631== 71,603,456 bytes in 288,752 blocks are still reachable in loss
> record 26 of 26

This could be a side effect of the slab allocator. Use
G_DEBUG=always_malloc valgrind ... to circumvent the glib default
allocator.

This URL has some interesting points
http://www.tinymail.org/trac/tinymail/wiki/MemoryStats

The problem I propose, is the long lifetime of the data structure
initialized by g_mime_init. That call and it's closing counterpart
g_mime_close are called only once per lifetime of dbmail-imapd. That's
too long most likely. Moving the g_mime_init/g_mime_close to once per
login/logout session will help here I'm pretty sure, without risk. Let's
see.



-- 
  ________________________________________________________________
  Paul Stevens                                      paul at nfg.nl
  NET FACILITIES GROUP                     GPG/PGP: 1024D/11F8CD31
  The Netherlands________________________________http://www.nfg.nl
_______________________________________________
Dbmail-dev mailing list
[email protected]
http://twister.fastxs.net/mailman/listinfo/dbmail-dev

Reply via email to