]> source.dussan.org Git - sonarqube.git/commitdiff
Log the max memory allocated to the scanner engine
authorJulien HENRY <julien.henry@sonarsource.com>
Tue, 7 May 2024 13:20:44 +0000 (15:20 +0200)
committersonartech <sonartech@sonarsource.com>
Mon, 13 May 2024 20:02:41 +0000 (20:02 +0000)
sonar-scanner-engine/src/main/java/org/sonar/scanner/bootstrap/SpringGlobalContainer.java

index b9de4071df23b8dd0a6bee2157b5b9bb52309646..9112b99c78bc68088bd84473b0989891c3d57bf7 100644 (file)
@@ -23,6 +23,7 @@ import java.time.Clock;
 import java.util.List;
 import java.util.Map;
 import javax.annotation.Priority;
+import org.apache.commons.io.FileUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -67,6 +68,9 @@ public class SpringGlobalContainer extends SpringComponentContainer {
   }
 
   public static SpringGlobalContainer create(Map<String, String> scannerProperties, List<?> extensions) {
+    if (LOG.isDebugEnabled()) {
+      LOG.debug("JVM max available memory: {}", FileUtils.byteCountToDisplaySize(Runtime.getRuntime().maxMemory()));
+    }
     return new SpringGlobalContainer(scannerProperties, extensions);
   }