[avahi] Memory consumption

Lennart Poettering lennart at poettering.net
Tue Apr 10 13:26:47 PDT 2012


On Tue, 10.04.12 15:23, Frank Lahm (franklahm at googlemail.com) wrote:

> Hi all,
> 
> I'm one of the Netatalk (OpenSource AFP fileserver) devs. We use Avahi
> via avahi_threaded_poll and friends in order to register the AFP
> server with mdns.
> We call the Avahi setup stuff once in our main process `afpd` here
> [1]. Handling user sessions is done by forking childs.
> 
> As it seems, when calling the Avahi setup functions, a big chunk of
> memory is taken:
>
> Obviously, we didn't bother calling the Avahi free ressources()
> functions in the forked afpd session childs as the damage done by
> sbrk() can't be undone by free().
> 
> The main concern I have with this memory consumption is that is handed
> down to every afpd process.
> 
> My questions are:
> - is the memory consumption of 10 MB as expected ?
> - do you see any way of preventing the inheritance of the memory
> consumption without running the Avahi registration in an dedicated
> process ?

I don't see where the Avahi client libraries cuould do such a big
allocation. My only guess is that this is actually the D-Bus library
that does this (it maintains a message cache). To figure this out it
might be worth to plot the memory usage with a tool like valgrind's
massif tool?

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the avahi mailing list