Sonarlint uses too much memory

1,201 views
Skip to first unread message

Alexandros Bokas

unread,
Apr 20, 2018, 5:33:15 AM4/20/18
to sona...@googlegroups.com

Hello Sonarlint Team,

 

I want to tell you something about a bug on sonarlint.

Sonarlint-Version: 3.4.0.201803051332

Eclipse-Version: Version: Neon.3 (4.6.3) Build id: M20170301-0400

 

In our company we have two java eclipse projets about 400 files each.

The analysis of these project doesn't work unless i push the xmx value in the eclipse.ini up to 4096m.

This issn't acceptable because the RAM is under too much load.

Other java projects are not affected.

 

I send you two screenshots about the error warning.

Our other projects which work have much more files.

 

Is there a bugfix available?

 

Greetings

Alexandros J

 

Alexandros Bokas

unread,
Apr 20, 2018, 5:34:26 AM4/20/18
to sona...@googlegroups.com

Forgotten screenshots.

 

Greetings

Alexandros

Error_Picture_One.png
Error_Picture_Two.png

Julien HENRY

unread,
May 3, 2018, 3:02:20 AM5/3/18
to Alexandros Bokas, sona...@googlegroups.com
Hi Alexandro,

This is really hard to investigate such problem without being able to reproduce. Our analyzers are designed to work mostly "per file" (= analyze a file, report issues, clean memory, then move to the next file), so it means the total number of files of the project should not be a concern.
So there are two options:
  * we have a memory leak somewhere (could be in the analyzer or in the Eclipse integration side). You should be able to observe a slow increase of the memory during
  * some files are causing a huge memory consumption. For example, it already happened that some uncommon Java constructs would cause the analyzer to go in a very deep recursion.

To investigate the first case, you can use a profiler (like jvisualvm) to monitor memory consumption in Eclipse. Try to take a heap dump when memory is clause to the limit, then you can try to look for objects that consume the most memory. Note that it can be tricky with such a big heap.
For the second one, you can use a dichotomy approach to try to identify the offending file(s) (select only part of the files to be analyzed).

Few additional questions:
  - how long does it take to run the full analysis?
  - are you using connected mode, and if yes, what is the version of the sonar-java plugin on your SonarQube server?

++

Julien Henry | SonarSource

Developer

https://sonarsource.com


--
You received this message because you are subscribed to the Google Groups "SonarLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarlint/DB6PR0902MB2101386EF0273BA1B4AB3C689BB40%40DB6PR0902MB2101.eurprd09.prod.outlook.com.

For more options, visit https://groups.google.com/d/optout.

Alexandros Bokas

unread,
May 8, 2018, 5:13:43 AM5/8/18
to Julien HENRY, sona...@googlegroups.com

Hello Julien,

 

We think we found the problem.

 

In the screenshot you see our language is java but sonarlint also analyses some directories with big( > 3GB) binary files.

If we delete these files, sonarlint analyzes the project without errors. (216 files 0 excluded)

 

We tried to exclude all binary files with *.bin on the java project in context menu.

Also i tried on "sonar-project.properties" with sonar.exclusions=**/*.bin, src/test/files/**/*.bin, config/**/*.bin

Also we tried to exclude all binary files with *.bin, all files from the folder files with src/test/files/**/* and all files from the folder config with config/* and config/**/* on Eclipse Menu Windows -> Preferences -> Sonarlint -> File Exclusions. It show the error message 216 files to analyse and 238 excluded, but it still doesn’t work.

 

So why does sonarlint analyze these binary files although we don’t want it. Do you have an idea what we can do?

 

Greetings

Alexandros

To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+...@googlegroups.com.

screenshot_sonar-projekt_properties.png

Julien HENRY

unread,
May 14, 2018, 12:03:23 PM5/14/18
to Alexandros Bokas, sona...@googlegroups.com
Hi Alexandros,

sonar-scanner.properties is the configuration file of the SonarQube Scanner. SonarLint will not use it.

Adding an exclusion in Eclipse project configuration should work, but I think your problem is caused by https://jira.sonarsource.com/browse/SLCORE-129 (file is indexed eagerly, even if it is excluded). I will try to reproduce.

++

Julien Henry | SonarSource

Developer

https://sonarsource.com


To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+unsubscribe@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages