I use tracker miner on my computer, I need it to search through files when I’m coding with vscodium for example, but when I activate it, my battery life goes from 6/7 hours to less than an hour. My computer heats up and CPU usage is constantly at 100%.
I don’t know what to do and yet tracker miner only indexes the following folders:
user@framework13:~$ gsettings get org.freedesktop.Tracker3.Miner.Files index-recursive-directories
['&DESKTOP', '&DOCUMENTS', '&MUSIC', '&PICTURES', '&VIDEOS']
Any idea where to look and how to fix the problem?
File indexing software are annoying for battery life. Yes, they peg the CPU at 100% on one core, being at the same time inefficient by not using all the CPU core but still using your full CPU TDP (max power limit) so that your battery is drained. The first run is especially demanding since absolutely everything is indexed so its a lot to process, subsequent runs are usually not as long and as thirsty on CPU, power and battery.
Solution 1: Don’t use file indexing, really it isn’t worth it, if you have swap you don’t really need it
Solution 2: Plug your laptop and let the first run complete then use the laptop having only 1-2h less of battery life than before.
It’s curious what you’re saying, I didn’t know that about swap.
Principally, VSCodium was very annoying saying that max files indexed by tracker miner was being reached every time I opened the app, and that I couldn’t continue to index files, and I couldn’t use the search feature in VSCodium. That’s when I increased max files in tracker miner and my battery started to suffer from it.
No I have deactivated tracker miner, I don’t have CPU or battery issues, and VSCodium doesn’t make any problem, I can search though files… XD
Nice for you! Yeah these file indexing programs aren’t necessary at all for most consumer. Just annoying that devs continue pushing them, especially on laptops where it eats the battery!
Oh yeah, my bad, bad memory
I guess I should explain how swap makes tracker-miner not so much usefull: by default, there are mainly 2 things in RAM: cached files that are (more or less) regularly accessed and programs content (eg, chrome tabs, etc). Your system constantly balances between these two main things. Obviously, program contents are more important than cache wich can be rebuilt at anytime. That’s why even if you got 64Gb of RAM, most of it is used, as cache makes the system faster so it’s always better to have cache than to do nothing with the RAM. That’s why people always feel they are ‘out’ of RAM where in realty they aren’t really out of RAM, when something needs RAM, the system will remove cache from the RAM and allocate this memory. When there is no more cache (or very little), the system starts putting programs that aren’t actively using their content in RAM. When appropriate, the OS can also decide that some cache is more worthy than some program content that hasn’t been used for a long time, putting that into swap. When needed, things are retrieved from swap.
However, you should always use swap if you want a healthy system, even if you have a lot of RAM, because 1. it’s a basic mechanism that allows the PC to perform better than no swap (no swap would make the PC drop important cache when unimportant programs could be moved to swap, dropping performance a lot), and 2. if you are with no swap and out of memory, the OOM killer will start closing everything in an emergency, starting with the programs that consume the most RAM, possibly crashing the system or leaving an app in a bad save state. That’s why you always want some swap like 1Gb, just to allow the system some room to breathe and perform. In the past (15+ years ago), swap behaved badly sometimes on linux, therefore giving swap a bad reputation however, it’s not the case at all anymore. Running no swap is akin to adding a turbo to a car but choking the intake so that the car can anyways pull the same amount of air as before adding the turbo. Dumb at best, potentially destructive at worst. Let your turbo breathe!
Indexing systems are just building a database to find files faster, but if those files are already in memory because you have sufficient swap (and therefore healthy RAM management), you will access those files at the exact same speed. The cache built by tracker-miner is mostly redondant.