Excessive memory taken by `known-findings-store` folders

For me it’s not the .sonarlinttmp folders but literally 8600 known-findings-store folders, adding up to nearly 43 gig. I am using the VSCode extension, version 4.15.0.

I do work on a number of fairly large repos, and am one of those too-many-tabs people, but still. One interesting thing is that I resorted by date modified, and the oldest of those folders is only 3 days old. That’s a lot of findings for three days!

EDIT: It’s 5 minutes later, and the oldest handful of known findings folders disappeared, with the oldest again 3 days old… but, like, exactly three days, to the minute. So clearly y’all are pruning. Maybe 72 hours is too much, though.

1 Like

Hello @lobsterkatie,

Thanks for reporting here. I’m surprised that you have so many folders. How do you usually exit from VSCode? Do you close it normally or do you kill it?

The extension is supposed to clean things up before exiting. Could you try another time and confirm that when you open VSCode, a new folder is created, and when you close it gracefully, it stays there?

How do you usually exit from VSCode?

LOL. Exit VSCode? What’s that?

Seriously, though, if exiting VSCode is the primary clean up time, that would def explain how they accumulate. The only time I ever quit VSCode is if it has an update and needs to be restarted or when I restart my machine (which I think my company forces… once a month, maybe?). Also very occasionally if VSCode is really acting up (taking a full minute to save, for example), I’ll restart it. Otherwise, it is always running.

That said, the 72-hour cleanup seems to happen whenever the extension activates. Just now, there were 16 folders labeled Feb 2, 10:33 pm, and while they didn’t disappear the moment the clock hit 10:33 (nor yet 10:34), they did disappear as soon as I switched to VSCode, added and deleted a newline, and saved the file (which I presume triggered SonarlLint to run).

So could whatever routine enforces the 72-hour limit also force a max count limit? Or could the window be shortened? Out of curiosity, how are any of the folders older than the most recent one used?

Sure, we could think about doing more aggressive cleanup. But there are 2 things that bother me:

  1. SonarQube for IDE should create only one new folder at startup (per VSCode window)
  2. Apparently the folders are not deleted when closing a VSCode window, and it should be the case

With what you described, I’m surprised to see many folders created “Today” in your screenshot. Just to understand a bit better:

  1. Do you have several VSCode windows opened at the same time?
  2. When you open one, does only one new folder appears?
  3. When you work normally in a given window, are there new folder appearing?
  4. When you close the window, does the folder created at startup disappears? This is important as it should be the primary cleanup mechanism
  5. What languages do you use in your projects?

Sorry to bother you with all those questions, but I would like to fix this annoying bug for good

No worries. I get it - the more info you have, the easier it is to fix!

  1. You know that t-shirt that’s like, My brain has too many tabs? They’re going to put that on my tombstone. I currently have 6 VSCode windows open, with 13, 11, 5, 5, 19, and 96 tabs, respectively.

  2. Okay, so I opened a window which had 19 tabs in it from the last time it was open. (So a total of 7 windows open.) The only folder that appeared in .sonarlint was an xodus-local-only-issue-store folder. Then I added and removed a newline and saved, and I got 6 known findings folders and a .sonarlinttmp folder. (UPDATE: Now while I’ve been writing this to you, three more known findings folders have appeared. VSCode is running in the background, but I didn’t switch to it during the time that they appeared.)

  3. So I just switched back to VSCode and nothing happened. Switched windows, still nothing. Switched branches, and 5 more known findings folders appeared. This is maybe another clue. I rebase constantly, flip flop between branches, rename them, push and pop commits off the top of them, reset them, and otherwise mess about in git all day. (I swear, there’s a method to the madness.) (Also, while I’ve been typing this answer to question 3, another 3 known findings folders have appeared. Oh, and just now another three… Oh, interesting - they seem to be coming at 5-minute intervals. <waits 5 minutes> Yup, here are another 3.)

  4. I just closed that same 7th window that I’d opened, and both the xodus-local-only-issue-store folder and the .sonarlinttmp folder I mentioned before disappeared, but none of the known findings ones did. Also, a new folder called storage appeared.

  5. I work primarily in Python, but also a bit in TS. Then there’s always the odd config file, some JSON, some plain text… Lemme actually see what I have open right now… Okay, in among all of those open tabs, there’s python, yml, json, txt, toml, md, rust, bash, gitconfig and gitignore, env, and html. But the vast, vast majority of the changes that are getting made and the tabs which are focused are python. (Meanwhile, two more sets of 3 known findings folders have appeared, still at 5 minute intervals, and just now 6 new .sonarlinttmp folders appeared.)

  6. (bonus) Just noticed that VSCode had an update, so I restarted it (using the Restart to Update command). When it shut down, all of the latest .sonarlinttmp folders disappeared, and 6 new known findings folders appeared, along with a storage folder. No known findings folders disappeared, though. When VSCode started back up, nothing happened. I waited for all of the extensions to load, the focused editor to be parsed and have its outline show up, the terminal to finish reloading, etc - across all 6 windows. Still no new folders. Then I came here to type this answer #6, and just now when I switched back to Finder… this had happened:

Everything above storage is new since I started typing #6. :grimacing:

Anyway, this is lot of detail, sorry, but I hope it’s helpful! Happy to try anything else you’d like.

4 Likes