shanthoosh commented on code in PR #1717:
URL: https://github.com/apache/samza/pull/1717#discussion_r2213903101


##########
samza-core/src/main/java/org/apache/samza/container/host/PosixCommandBasedStatisticsGetter.java:
##########
@@ -44,20 +47,71 @@ public class PosixCommandBasedStatisticsGetter implements 
SystemStatisticsGetter
   private List<String> getAllCommandOutput(String[] cmdArray) throws 
IOException {
     log.debug("Executing commands {}", Arrays.toString(cmdArray));
     Process executable = Runtime.getRuntime().exec(cmdArray);
-    BufferedReader processReader;
     List<String> psOutput = new ArrayList<>();
 
-    processReader = new BufferedReader(new 
InputStreamReader(executable.getInputStream()));
-    String line;
-    while ((line = processReader.readLine()) != null) {
-      if (!line.isEmpty()) {
-        psOutput.add(line);
+    try (BufferedReader processReader = new BufferedReader(new 
InputStreamReader(executable.getInputStream()));

Review Comment:
   Can we please clarify how did we have verify and test the changes end-to-end 
such that it addresses the leack problem? 



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