High CPU load while idle

Hi,

I observe a constantly high CPU load with my local vaults on macOS Monterey, except for the sandbox vault.

Things I have tried

  • I enabled safe mode
  • I disabled all core plugins
  • I disabled the legacy editor
  • I re-installed Obsidian (ie, move app to trash, download & move app to /Applications)

Nothing of these steps changed anything.

CPU load for the main process remains constantly high, between 60% and 95% (mostly around 80%).

The Sandbox vault show a near-zero CPU load.

The Performance tab of the Web Dev Tools shows near-zero CPU for most of the time, while the Activity Monitor continuously shows a high load.

Profile-20220629T192925.json.zip (181.1 KB)

When I created a fresh vault from an existing folder (a quite small one, 470 files, mostly non-Markdown files), CPU load is as low as when using the Sandbox vault.

Which makes me wonder if all of my local vaults have some issue with their config or caches?

How can I troubleshoot this further?

What I’m trying to do

Nothing in particular. I only want to use my vaults without maxing out the fans.

2 Likes

Update: Seems to have been some background indexing going on.

I opened all vaults and let Obsidian run for a few hours, and now all Obsidian processes are near 0% CPU/GPU time.

I will observe this further, but for now, things look quite good.

It would be good to have some more tooling available to better identify which long-running thread keeps the CPU busy for hours.

2 Likes

Unfortunately, my Obsidian app keeps returning to 50-80% CPU.

Does Obsidian run regular indexing or caching tasks in the background that take hours to complete?

1 Like

I’m not seeing this on my Mac. I would expect the things you tried would clear up or reveal the source of the problem. Just to add to the list of basics: did you try rebooting the computer?

Are you using any kind of sync (Obsidian Sync, iCloud, Dropbox, etc.)?

Thanks for the suggestion. Although rebooting is mainly a problem solver for Windows rather than Mac/Unix, I tried this today, but Obsidian went to ~80% CPU load again.

I let btop track the per-app CPU usage. For two hours, usage was between 50-90%.

After that, the CPU usage turned into an on-off pattern (a few seconds of activity followed by a few seconds of idling). After 4 hours of uptime, the pattern still persists.

I still suspect that some internal indexing is going on here, but I have no idea how to track that down further, besides staring at CPU graphs.

Some things you might try (I’m just spitballing):

  • Make a copy of your vault folder and open it as a vault in Obsidian. Does it have the same problem?
  • (After backing up) Try deleting or renaming config files 1 by 1 and restarting the app (I think Obsidian will regenerate ones that are missing, but you may want to research that). Does the behavior persist?
  • (After backing up, of course) Try removing other files 1 by 1, in case Obsidian is for some reason hung up on indexing one of them. As a first rough cut, you might remove all non-Markdown files, and if that has no effect put them back and try removing all Markdown files. If 1 of those does something and you have folders, you could get more granular by removing folders 1 by 1.

Thanks, @CawlinTeffid, for the help.

Testing config files one by one might make sense but on the other hand, I observe the problem with several of my vaults. They are completely separate. They don’t share files and are not nested inside each other.

Just now, I opened some random folder as a new vault. So this is a brand-new vault with standard settings. No community plugins enabled (safe mode=on), not too many files inside (1,361 to be precise, with only 2 Markdown files).

After opening the vault, CPU usage of Obsidian.app stays around 80% for a couple of minutes, then drops to near-zero.

(Note the elapsed time, and the disk I/O.)

This pattern repeats every time I close and re-open the vault.

I am more and more convinced that Obsidian does some initial indexing whenever a vault is opened. The larger the vault, the longer it takes. (One of my vaults has 60,000 files inside, of which 2003 are Markdown files.)

Edited to add: I do not refer to the one-time initial indexing that Obsidian does with brand-new vaults. It must be something else that happens at every start of a vault.

1 Like

Yeah, I’d expect it updates the index whenever you open a vault (because you could have changed the files while it was closed). I normally leave mine open all the time. I closed and reopened it and saw CPU go pretty high, settle at around 40%, then go back down, all taking about half a minute (this is on an M1 MacBook Air).

Maybe there is something here to explore?

That does look excessive (to not-an-Obsidian-developer me). And the I/O on the earlier pics you posted goes up to almost 1 GB.

I am on a MacBook Pro 2017. The 60,000-files vault keeps the CPU busy for ~2 hours.

Maybe I should upgrade… :slight_smile:

Oh yeah, I forgot to mention that my vault has 6,000 files (mostly Markdown).

I would hope that your computer should be able to handle Obsidian without much trouble (I was thinking you might have an old Air; anyway I realized that I won’t have much insight into normal performance problems).

I’ll try putting my vault on my old Linux machine to see what happens, but I don’t know when I’ll get around to it.

1 Like