[Xfce4-commits] r20342 - xfce4-panel/trunk/panel

Benedikt Meurer benedikt.meurer at unix-ag.uni-siegen.de
Sat Mar 11 20:43:54 CET 2006


Jasper Huijsmans wrote:
>>>>Setting $DISPLAY in the panel process doesn't seem to be a good idea.
>>>>Why don't you use gdk_spawn_on_screen() and friends?
>>>
>>>Because not all plugins are external. I think I do use 
>>>gdk_spawn_on_screen() otherwise.
>>>
>>>Why not set DISPLAY in the panel process?
>>
>>Because xfce_setenv() "leaks" memory on many operating system.
> 
> Aha, I didn't know that. I'll try to do something else then. Thanks.

This affects glibc, Solaris and a bunch of other systems, where putenv()
manages only the list of environment variables, but doesn't really
manage the memory for the entries. Therefore when replacing an existing
entry with a newly malloc()ed key/value pair, the old pair isn't freed
properly. Even on systems where putenv()/setenv() actually takes care of
the memory management, there's no warranty that the memory usage will
not increase constantly.

That's why long running processes like the panel shouldn't call putenv()
and friends in its process (you can of course call it in the child
process prior to invoking execve(), but then you could also just use
gdk_spawn_on_screen() and friends). Otherwise the panel memory usage
will grow constantly, only in small chunks, but still noticably after
some time.

> 	Jasper

Benedikt



More information about the Xfce4-dev mailing list