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 739A9200B71 for ; Wed, 31 Aug 2016 11:51:35 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 71FF8160AB4; Wed, 31 Aug 2016 09:51:35 +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 DF5F7160A8C for ; Wed, 31 Aug 2016 11:51:34 +0200 (CEST) Received: (qmail 85938 invoked by uid 500); 31 Aug 2016 09:51:34 -0000 Mailing-List: contact dev-help@flink.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flink.apache.org Delivered-To: mailing list dev@flink.apache.org Received: (qmail 85927 invoked by uid 99); 31 Aug 2016 09:51:33 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 31 Aug 2016 09:51:33 +0000 Received: from mail-it0-f52.google.com (mail-it0-f52.google.com [209.85.214.52]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id B4B941A0289 for ; Wed, 31 Aug 2016 09:51:33 +0000 (UTC) Received: by mail-it0-f52.google.com with SMTP id g62so85898180ith.1 for ; Wed, 31 Aug 2016 02:51:33 -0700 (PDT) X-Gm-Message-State: AE9vXwPLJI3EMfiIu4fmeXMK6EIpHgMCEsQGE7hRMEbDoRhoE8rVzIa6x8XJR1sXrD0OPtlr90hXDqBhA7gKDA== X-Received: by 10.36.20.9 with SMTP id 9mr11841948itg.24.1472637092878; Wed, 31 Aug 2016 02:51:32 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.171.7 with HTTP; Wed, 31 Aug 2016 02:51:32 -0700 (PDT) In-Reply-To: References: From: Stephan Ewen Date: Wed, 31 Aug 2016 11:51:32 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Streaming - memory management To: "dev@flink.apache.org" Content-Type: multipart/alternative; boundary=001a11446af8cdf3f5053b5b0af3 archived-at: Wed, 31 Aug 2016 09:51:35 -0000 --001a11446af8cdf3f5053b5b0af3 Content-Type: text/plain; charset=UTF-8 In streaming, memory is mainly needed for state (key/value state). The exact representation depends on the chosen StateBackend. State is explicitly released: For windows, state is cleaned up automatically (firing / expiry), for user-defined state, keys have to be explicitly cleared (clear() method) or in the future will have the option to expire. The heavy work horse for streaming state is currently RocksDB, which internally uses native (off-heap) memory to keep the data. Does that help? Stephan On Tue, Aug 30, 2016 at 11:52 PM, Roshan Naik wrote: > As per the docs, in Batch mode, dynamic memory allocation is avoided by > storing messages being processed in ByteBuffers via Unsafe methods. > > Couldn't find any docs describing mem mgmt in Streamingn mode. So... > > - Am wondering if this is also the case with Streaming ? > > - If so, how does Flink detect that an object is no longer being used and > can be reclaimed for reuse once again ? > > -roshan > --001a11446af8cdf3f5053b5b0af3--