Bug Fixes in KDE Base
FileWatch: Avoid calling the addWatch function recursively
A watch needs to be added for each directory. If we try to add the
watches recursively, then at each level a new string is allocated which
consumes memory. This memory is eventually freed, but that doesn't
decrease the filewatch service's memory footprint.
Additionally, this extra memory can be quite large depending on how your
directory is structed. For me it makes a memory difference of about
50mb, but bug reports indicate that it can go as high as 2gb.
_k_addWatches() now only adds one watch and then calls itself. It
additionally traverses the file system tree in a depth first manner in
order to avoid extra memory allocations. (Breadth first costs more