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


##########
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:
   In this case, is the total physical memory useful? The `Runtime` memory 
methods provide heap information, which is actually addressable for the 
process, versus the physical memory, which may or may not be available to the 
JVM.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to