https://bugs.kde.org/show_bug.cgi?id=437754

            Bug ID: 437754
           Summary: "balooctl status" can trigger high memory use
           Product: frameworks-baloo
           Version: 5.82.0
          Platform: Other
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: Baloo File Daemon
          Assignee: stefan.bru...@rwth-aachen.de
          Reporter: tagwer...@innerjoin.org
                CC: baloo-bugs-n...@kde.org, n...@kde.org
  Target Milestone: ---

SUMMARY:

    Baloo's index size and memory usage can balloon when running
    "balooctl status" while baloo is handling file deletions.

STEPS TO REPRODUCE:

    Create a temporary folder and create 50000 one-line files in it:

        mkdir ~/Testdir
        cd ~/Testdir
        for i in {1..50000}; do echo "This is file $i" > file$i.txt; done 

    Baloo will need a while to index these, watch with

        balooctl monitor 

    in one window and check the count of indexed files with

        balooctl status 

    It's quite likely that creating so many files so quickly hits the
    inotify "event limit" and baloo doesn't get told of all the new files.
    Run

        balooctl check 

    to get it to look for any files it's missed. Keep an eye on the index
    size and the memory used by baloo_file as shown by htop. There's
    nothing remarkable

    Remove the test folder

        rm -r ~/Testdir 

    Keep watching the index size and the memory used by baloo_file. Still
    no sign anything untoward...

    Run

        balooctl status; balooctl indexSize 

    a few times and ... 

OBSERVED RESULTS:

    ... "balooctl status" takes a considerable amount of time to respond.
    The "File Size" reported by "balooctl indexSize" increases quite
    dramatically (while the "Used" count is dropping slowly).
    "balooctl monitor" does not report file deletions.

    Watching the memory used (MEM%) by baloo_file as shown by htop is
    similarly increasing, more-or-less in line with the "File Size"

    For my tests, the initial "File Size" was 50 Mbyte with "Used" 28 MByte.
    After several runs of "balooctl status" while baloo is dealing with file
    deletions, "File Size" had risen to 2.8 Gbyte.

        Baloo File Indexer is running
        Indexer state: Idle
        Total files indexed: 29,476
        Files waiting for content indexing: 0
        Files failed to index: 0
        Current size of index is 2.98 GiB

        File Size: 2.98 GiB
        Used:      16.07 MiB

    MEM% was also shown as 2.8 Gbyte, or about 75% of total memory (in
    a 4 GByte machine)

    The guesswork here is that "balooctl status" is counting the
    indexed files and is locking the db so that writes don't change the
    number. However the process of deleting entries continues and the
    changes are appended to the DB. This seems strange and better
    explanations are welcome 8-/

EXPECTED RESULTS:

    Baloo maintains a count of indexed files and "balooctl status" can
    show it without needing to lock the DB and count the entries.

    "balooctl monitor" should probably show files as they are deleted (as
    a bit of reassurance that something is happening)

SOFTWARE/OS VERSIONS:

    Checked on Neon Unstable...
    Plasma: 5.22.80
    Frameworks: 5.83.0
    Qt: 5.15.2 

ADDITIONAL INFORMATION:

    Once baloo_file memory usage has gone up, it does not drop down again.
    You need to restart baloo

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to