pvillard31 commented on code in PR #7891:
URL: https://github.com/apache/nifi/pull/7891#discussion_r1362383549


##########
nifi-bootstrap/src/main/java/org/apache/nifi/bootstrap/RunNiFi.java:
##########
@@ -1392,6 +1407,45 @@ public boolean accept(final File dir, final String 
filename) {
         }
     }
 
+    private String printBasicOSJavaDetails(final String xms, final String xmx) 
{
+        ObjectMapper mapper = new ObjectMapper();
+        ObjectNode details = mapper.createObjectNode();
+
+        // java version
+        details.put("javaVersion", System.getProperty("java.version"));
+
+        // num cores
+        final OperatingSystemMXBean os = 
ManagementFactory.getOperatingSystemMXBean();
+        details.put("cores", os.getAvailableProcessors());
+
+        // max file descriptor count + total physical memory
+        try {
+            final OperatingSystemMXBean osStats = 
ManagementFactory.getOperatingSystemMXBean();
+            final Class<?> unixOsMxBeanClass = 
Class.forName("com.sun.management.UnixOperatingSystemMXBean");
+            if (unixOsMxBeanClass.isAssignableFrom(osStats.getClass())) {
+                final Method totalPhysicalMemory = 
unixOsMxBeanClass.getMethod("getTotalPhysicalMemorySize");

Review Comment:
   I believe that some users tend to set a very high heap, not leaving enough 
room for off-heap. Having the total memory available on the host may be useful. 
If the information is not available, we would see a null value.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to