Memory leak in SonarQube for Visual Studio

Please provide

  • Operating system: Windows 11
  • Visual Studio version: Visual Studio 2022 Enterprise Version 17.14.21 (November 2025)
  • SonarQube for Visual Studio plugin version: Sonar Qube for Visual Studio 9.2.0.15907
  • Programming language you’re coding in: Should be C#
  • Is connected mode used:
    • SonarQube Cloud, SonarQube Server, or SonarQube Community Build? (if one of the latter two, which version?): Not sure, would need to ask

And a thorough description of the problem / question:

One of our developers sent me following report regarding your VS IDE extension and asked me to forward it:

The main issues I have with the Sonar Qube for Visual Studio extension is that:

  1. it disables itself on a regular basis and you won’t even know that it is no longer working.
  2. it requires up to a peak of 1.5 GB of memory with only one open solution

All memory measurements were performed by checking the memory consumption of Open JDK Platform binaries (no other java tools running).
standard consumption: 400-700 MB per open solution
open single (very large) file with 8000 lines: consumption up to 800-900 MB
open another medium sized file: + 100 MB
open another small file: + 50 MB
close all files: no change in consumed memory
wait some minutes: still no change in consumed memory

You can easily see how this can amount to 1500 MB for a single solution after some hours.

Project is a legacy project with 565k Lines of Code and a Maintainability rating of A.
Project is composed of three separate solutions. Opening those three with a single small open file 30-120 lines takes 550 MB + 430 MB + 400 MB.
Note that this is comparable to what Resharper is using, so it might not be that critical. (Resharper might even use more memory, but arguably reports many more issues)
The critical point is that the memory is never freed – as far as I can tell.

Could you please have a look at this?

Hi. This doesn’t look great, I agree.

To investigate this further, could you please clarify a few things:

  1. Is it the java child process that has high memory consumption or the main VS process?
  2. How many files (roughly) does the project have? How many issues (rough count of all known issues, including muted)?
  3. Does the memory get released when all solutions are closed, but VS is still running?
1 Like

Hi,
thanks for your feedback, here are the requested answers from the developer:

  1. It is the java child process that has high memory consumption (main vs process also has high memory consumption, but this is not your problem :wink:).

  2. Server solution 3495 files
    Client solution 1469 files
    Integration Tests solution (not in SonarQube) 1839 files
    7k Issues in SonarQube in all analyzed files

  3. My test was:
    Open single Visual Studio
    Open solution with many open files – Java process starts at 360 MB and then starts to load more
    Open biggest file – Java process peaks at 890 MB
    Close solution – Java process is back to 650 MB
    So yes, some of the memory is released. But I would have expected it to return to 360 MB which is still high, but acceptable.

Hi,

Could you please capture the heap dump so we can analyze what actually is taking the space? You can share it in a private message with me (I will ping you)

If you need more info, you can start by looking at this: https://www.baeldung.com/java-heap-dump-capture

Hi,
unfortunately, I can not. We are working on customer projects under strict NDAs, I am sure a heap dump would contain data which violates the NDAs here, even if shared in private.
Kind regards

Hi, would you be able to collect statistics yourself? We don’t really need the full memory dump, but rather which types use the most memory