YARN-1870. FileInputStream is not closed in ProcfsBasedProcessTree#constructProcessSMAPInfo. (Fengdong Yu via junping_du)

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1588324 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Junping Du 2014-04-17 18:05:43 +00:00
parent ad9edb02b9
commit 36ed8c74ea
2 changed files with 4 additions and 2 deletions

View File

@ -53,6 +53,9 @@ Release 2.5.0 - UNRELEASED
YARN-1923. Make Fair Scheduler resource ratio calculations terminate faster
(Anubhav Dhoot via Sandy Ryza)
YARN-1870. FileInputStream is not closed in ProcfsBasedProcessTree#constructProcessSMAPInfo.
(Fengdong Yu via junping_du)
OPTIMIZATIONS
BUG FIXES

View File

@ -20,7 +20,6 @@
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
@ -736,7 +735,7 @@ private static void constructProcessSMAPInfo(ProcessTreeSmapMemInfo pInfo,
fReader = new FileReader(file);
in = new BufferedReader(fReader);
ProcessSmapMemoryInfo memoryMappingInfo = null;
List<String> lines = IOUtils.readLines(new FileInputStream(file));
List<String> lines = IOUtils.readLines(in);
for (String line : lines) {
line = line.trim();
try {