When running balooctl index/clear with a lot of files it uses a lot of memory because transaction to DB is committed only at the end preventing lmdb to reclaim memory thus making memory use to only grow.
For example running balooctl index ./* on a folder with ~650 files made baloo to use 9GiB of RAM, m_pendingOperations.size() was 20M