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


##########
nifi-bootstrap/src/main/java/org/apache/nifi/bootstrap/RunNiFi.java:
##########
@@ -1165,13 +1171,22 @@ public void start(final boolean monitor) throws 
IOException {
 
         nifiPropsFilename = nifiPropsFilename.trim();
 
+        String xmx = null;
+        String xms = null;
+
         final List<String> javaAdditionalArgs = new ArrayList<>();
         for (final Map.Entry<String, String> entry : props.entrySet()) {
             final String key = entry.getKey();
             final String value = entry.getValue();
 
             if (key.startsWith("java.arg")) {
                 javaAdditionalArgs.add(value);
+                if(value.toLowerCase().startsWith("-xms")) {
+                    xms = StringUtils.substringAfter(value.toLowerCase(), 
"-xms");
+                }
+                if(value.toLowerCase().startsWith("-xmx")) {
+                    xmx = StringUtils.substringAfter(value.toLowerCase(), 
"-xmx");
+                }

Review Comment:
   Instead of parsing `Xmx`, what about using 
[Runtime.maxMemory()](https://docs.oracle.com/javase/8/docs/api/java/lang/Runtime.html#maxMemory--)?



-- 
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