Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 517C4200D3E for ; Thu, 16 Nov 2017 18:24:04 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 50116160BEA; Thu, 16 Nov 2017 17:24:04 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 98DFB1609EF for ; Thu, 16 Nov 2017 18:24:03 +0100 (CET) Received: (qmail 31133 invoked by uid 500); 16 Nov 2017 17:24:02 -0000 Mailing-List: contact commits-help@beam.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@beam.apache.org Delivered-To: mailing list commits@beam.apache.org Received: (qmail 31124 invoked by uid 99); 16 Nov 2017 17:24:02 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Nov 2017 17:24:02 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 20DABC1544 for ; Thu, 16 Nov 2017 17:24:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -100.002 X-Spam-Level: X-Spam-Status: No, score=-100.002 tagged_above=-999 required=6.31 tests=[RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id tyoAkErEgBgv for ; Thu, 16 Nov 2017 17:24:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 4950D5F24F for ; Thu, 16 Nov 2017 17:24:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id CEBAEE0E4A for ; Thu, 16 Nov 2017 17:24:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 7CB8E240DA for ; Thu, 16 Nov 2017 17:24:00 +0000 (UTC) Date: Thu, 16 Nov 2017 17:24:00 +0000 (UTC) From: "Luke Cwik (JIRA)" To: commits@beam.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (BEAM-3202) Multiple deserializations of PipelineOptions leaks memory MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 16 Nov 2017 17:24:04 -0000 Luke Cwik created BEAM-3202: ------------------------------- Summary: Multiple deserializations of PipelineOptions leaks memory Key: BEAM-3202 URL: https://issues.apache.org/jira/browse/BEAM-3202 Project: Beam Issue Type: Bug Components: sdk-java-core Reporter: Luke Cwik Fix For: 2.3.0 In particular, upon deserializing a PipelineOptions object, ProxyInvocationHandler.Deserializer calls ValueProvider.RuntimeValueProvider.setRuntimeOptions(options) which stores the (newly) deserialized PipelineOptions instance in a static map inside the RuntimeValueProvider class, where the key is an id obtained by calling deserializedOptions.getOptionsId(). The thing is, performing a serialize-deserialize cycle on a given PipelineOptions instance and invoking getOptionsId() yields different optionsIds. Therefore, multiple deserializations of the same PipelineOptions instance result in new keys being added to the static "optionsMap" map inside the ValueProvider.RuntimeValueProvider class. The fix is to populate the options id when PipelineOptions is created. This can be tested by creating a PipelineOptions object and then serializing/deserializing it and ensuring that it has the same options id as the original. -- This message was sent by Atlassian JIRA (v6.4.14#64029)