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.

2 Likes

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

Hello Katie,

That’s VERY helpful, thanks for sharing all those details!

I still don’t reproduce the problem but I think I found one thing in the code that could lead to this. I will investigate further. Would you be able to install a custom build to validate the fix?

There is still one last thing that I don’t understand, it’s about the 5min period. There is no such period in any triggered task. Could you enable verbose logging, and check if there is any activity in the logs when new folders are created every 5min?

Thanks again!

1 Like

Hi,

I made a fix so less folders should appear, and they should all be cleaned up when leaving VSCode. The new version was just released, could you please update and give it a try? Thanks!

2 Likes

v4.19.0 issue is still present, just deleted 50gb of known findings store files.

Hello @SmailG,

Are you also using MacOS? Could you check if several folders appear for a single VSCode instance, or if is there only one created but it is not deleted when VSCode exits? I would also be interested in getting verbose logs, see instructions above

Thanks for reporting

Deleted my comment by mistake.

My folder is currently using 40GB of Hard Disk.

The folders when I took a screenshot before opening vscode

After opening the project with 6 tabs open: 5 .py files and 1 .csv file

To answer the questions asked:

  1. No, at the moment I’m only using one. Sometimes I open 2 at a time, using 2 different profiles
  2. As you have seen, 6 new folders were created when opening the window
  3. Everytime I pressed enter on a .py file (Not even saving) it created a new file:
  4. The temp folder was deleted, but as seen on the previous screenshot, it was already deleted event with vscode open. A new folder was created called storage and none of the folders were deleted. Folder has 17 items
    <Can’t add printscreen of the storage folder as I’m blocked>
  5. Language used is english

Extension sonarsource.sonarlint-vscode at version 4.20.2

VSCode details

VSCode information

Version: 1.99.2
Commit: 4949701c880d4bdb949e3c0e6b400288da7f474b
Date: 2025-04-10T01:21:25.295Z
Electron: 34.3.2
ElectronBuildId: 11161073
Chromium: 132.0.6834.210
Node.js: 20.18.3
V8: 13.2.152.41-electron.0
OS: Linux x64 6.11.0-24-generic snap

System Details Report

System details

Report details

  • Date generated: 2025-04-25 08:31:08

Hardware Information:

  • Hardware Model: ASUSTeK COMPUTER INC. PRIME A320M-K/BR
  • Memory: 32.0 GiB
  • Processor: AMD Ryzen™ 5 3600 × 12
  • Graphics: NVIDIA GeForce RTX™ 3060
  • Disk Capacity: 2.2 TB

Software Information:

  • Firmware Version: 5604
  • OS Name: Ubuntu 24.04.1 LTS
  • OS Build: (null)
  • OS Type: 64-bit
  • GNOME Version: 46
  • Windowing System: X11
  • Kernel Version: Linux 6.11.0-24-generic

List of extensions on profile

Extensions

bierner.markdown-mermaid
bpruitt-goddard.mermaid-markdown-syntax-highlighting
charliermarsh.ruff
cssho.vscode-svgviewer
davidanson.vscode-markdownlint
docker.docker
donjayamanne.githistory
donjayamanne.python-environment-manager
donjayamanne.python-extension-pack
eamodio.gitlens
ecmel.vscode-html-css
formulahendry.code-runner
github.copilot
github.copilot-chat
github.remotehub
github.vscode-pull-request-github
gitlab.gitlab-workflow
grapecity.gc-excelviewer
gruntfuggly.todo-tree
humao.rest-client
igorsbitnev.error-gutters
johnpapa.vscode-peacock
kevinrose.vsc-python-indent
magicstack.magicpython
mechatroner.rainbow-csv
mkxml.vscode-filesize
ms-azuretools.vscode-docker
ms-dotnettools.vscode-dotnet-runtime
ms-python.black-formatter
ms-python.debugpy
ms-python.isort
ms-python.pylint
ms-python.python
ms-python.vscode-pylance
ms-toolsai.datawrangler
ms-toolsai.jupyter
ms-toolsai.jupyter-keymap
ms-toolsai.jupyter-renderers
ms-toolsai.vscode-jupyter-cell-tags
ms-toolsai.vscode-jupyter-slideshow
ms-vscode-remote.remote-containers
ms-vscode.azure-repos
ms-vscode.live-server
ms-vscode.makefile-tools
ms-vscode.remote-explorer
ms-vscode.remote-repositories
ms-vscode.remote-server
ms-vscode.test-adapter-converter
ms-vsliveshare.vsliveshare
njpwerner.autodocstring
njqdev.vscode-python-typehint
oderwat.indent-rainbow
p1c2u.docker-compose
phplasma.csv-to-table
pkief.material-icon-theme
redhat.vscode-xml
redhat.vscode-yaml
richie5um2.vscode-sort-json
ryanluker.vscode-coverage-gutters
shd101wyy.markdown-preview-enhanced
shyykoserhiy.git-autoconfig
sonarsource.sonarlint-vscode
streetsidesoftware.code-spell-checker
streetsidesoftware.code-spell-checker-portuguese-brazilian
tamasfe.even-better-toml
tomoki1207.pdf
usernamehw.errorlens
visualstudioexptteam.intellicode-api-usage-examples
visualstudioexptteam.vscodeintellicode
wix.vscode-import-cost
yzhang.markdown-all-in-one

Hello Gabriel,

Thanks a lot for the additional details. The next time a new folder is created everytime you type, could you share with us two more things:

  • verbose logs
  • could you run the jps command in a terminal and share the result with us? I’m interested to see if there are several instances of sonarlint-ls.jar running