Revision 8f35439...

Go back to digest for 2nd December 2012

Bug Fixes in KDE Base

Vishesh Handa committed changes in [nepomuk-core] services/filewatch/kinotify.cpp:

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
memory)

REVIEW: 107529

File Changes

Modified 1 files
  • services/filewatch/kinotify.cpp
1 files changed in total