Return-Path: X-Original-To: apmail-hadoop-common-commits-archive@www.apache.org Delivered-To: apmail-hadoop-common-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 44C391830D for ; Tue, 2 Feb 2016 19:31:18 +0000 (UTC) Received: (qmail 14423 invoked by uid 500); 2 Feb 2016 19:31:18 -0000 Delivered-To: apmail-hadoop-common-commits-archive@hadoop.apache.org Received: (qmail 14359 invoked by uid 500); 2 Feb 2016 19:31:18 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-dev@hadoop.apache.org Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 14350 invoked by uid 99); 2 Feb 2016 19:31:18 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Feb 2016 19:31:18 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id C837BDFC8F; Tue, 2 Feb 2016 19:31:17 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: jlowe@apache.org To: common-commits@hadoop.apache.org Message-Id: <2db6cc5ac1aa43a48c1379520b671853@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: hadoop git commit: MAPREDUCE-6621. Memory Leak in JobClient#submitJobInternal(). Contributed by Xuan Gong Date: Tue, 2 Feb 2016 19:31:17 +0000 (UTC) Repository: hadoop Updated Branches: refs/heads/trunk dd9ebf6ee -> 43e669b22 MAPREDUCE-6621. Memory Leak in JobClient#submitJobInternal(). Contributed by Xuan Gong Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/43e669b2 Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/43e669b2 Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/43e669b2 Branch: refs/heads/trunk Commit: 43e669b22d9ac0b81ab8cc397c5d6d92bac986c6 Parents: dd9ebf6 Author: Jason Lowe Authored: Tue Feb 2 19:30:45 2016 +0000 Committer: Jason Lowe Committed: Tue Feb 2 19:30:45 2016 +0000 ---------------------------------------------------------------------- hadoop-mapreduce-project/CHANGES.txt | 6 ++++++ .../src/main/java/org/apache/hadoop/mapred/JobClient.java | 8 ++++++++ 2 files changed, 14 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/43e669b2/hadoop-mapreduce-project/CHANGES.txt ---------------------------------------------------------------------- diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index 55284da..a69453f 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -739,6 +739,9 @@ Release 2.7.3 - UNRELEASED MAPREDUCE-6618. YarnClientProtocolProvider leaking the YarnClient thread. (Xuan Gong via jlowe) + MAPREDUCE-6621. Memory Leak in JobClient#submitJobInternal() (Xuan Gong + via jlowe) + Release 2.7.2 - 2016-01-25 INCOMPATIBLE CHANGES @@ -1047,6 +1050,9 @@ Release 2.6.4 - UNRELEASED MAPREDUCE-6618. YarnClientProtocolProvider leaking the YarnClient thread. (Xuan Gong via jlowe) + MAPREDUCE-6621. Memory Leak in JobClient#submitJobInternal() (Xuan Gong + via jlowe) + Release 2.6.3 - 2015-12-17 INCOMPATIBLE CHANGES http://git-wip-us.apache.org/repos/asf/hadoop/blob/43e669b2/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/JobClient.java ---------------------------------------------------------------------- diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/JobClient.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/JobClient.java index baa6221..c43fc0a 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/JobClient.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core/src/main/java/org/apache/hadoop/mapred/JobClient.java @@ -577,10 +577,18 @@ public class JobClient extends CLI implements AutoCloseable { return job; } }); + + Cluster prev = cluster; // update our Cluster instance with the one created by Job for submission // (we can't pass our Cluster instance to Job, since Job wraps the config // instance, and the two configs would then diverge) cluster = job.getCluster(); + + // It is important to close the previous cluster instance + // to cleanup resources. + if (prev != null) { + prev.close(); + } return new NetworkedJob(job); } catch (InterruptedException ie) { throw new IOException("interrupted", ie);