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 2A807200BD1 for ; Mon, 14 Nov 2016 05:46:16 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 29376160B12; Mon, 14 Nov 2016 04:46:16 +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 71874160AE4 for ; Mon, 14 Nov 2016 05:46:15 +0100 (CET) Received: (qmail 89958 invoked by uid 500); 14 Nov 2016 04:46:14 -0000 Mailing-List: contact dev-help@apex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@apex.apache.org Delivered-To: mailing list dev@apex.apache.org Received: (qmail 89947 invoked by uid 99); 14 Nov 2016 04:46:14 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Nov 2016 04:46:14 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 0E5151A01CA for ; Mon, 14 Nov 2016 04:46:14 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -7.019 X-Spam-Level: X-Spam-Status: No, score=-7.019 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id kX0eYFlb_2G8 for ; Mon, 14 Nov 2016 04:46:12 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with SMTP id AF6205FC33 for ; Mon, 14 Nov 2016 04:46:11 +0000 (UTC) Received: (qmail 88247 invoked by uid 99); 14 Nov 2016 04:44:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Nov 2016 04:44:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 7DC752C0088 for ; Mon, 14 Nov 2016 04:44:58 +0000 (UTC) Date: Mon, 14 Nov 2016 04:44:58 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: dev@apex.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (APEXMALHAR-2335) Problems on StateTracker MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 14 Nov 2016 04:46:16 -0000 [ https://issues.apache.org/jira/browse/APEXMALHAR-2335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15662751#comment-15662751 ] ASF GitHub Bot commented on APEXMALHAR-2335: -------------------------------------------- Github user brightchen closed the pull request at: https://github.com/apache/apex-malhar/pull/493 > Problems on StateTracker > ------------------------ > > Key: APEXMALHAR-2335 > URL: https://issues.apache.org/jira/browse/APEXMALHAR-2335 > Project: Apache Apex Malhar > Issue Type: Bug > Reporter: bright chen > Assignee: bright chen > Original Estimate: 144h > Remaining Estimate: 144h > > The intension of StateTracker#bucketAccessed as I understand was to keep the last access time of each bucket so freeMemory can free the buckets which not accessed recently. > But here are some problems > - StateTracker#bucketAccessed() will be called each time access to the bucket. Current implementation use Concurrent map and set to handle it(bucketHeap and bucketAccessTimes). it could be pretty heavy. > - StateTracker#run use bucketHeap to get the bucket which need to free memory, but at the same time bucketHeap was constantly changed by bucketAccessed(). It could cause concurrent issue event bucketHeap is a Current set. And even more the while loop could never end. Following two bug probably related to this: > https://issues.apache.org/jira/browse/APEXMALHAR-2333 > https://issues.apache.org/jira/browse/APEXMALHAR-2334 > Following are my thought to solve these issue. > - It's not necessary to keep very accurate of update time, it probably only need to be updated once for each stream window. But StateTracker don't support endWindow() (in fact endWindow() was triggered at end of application window). So, we can keep the bucket which updated in this period and update only at the end of the period. > - keep two sets of bucketHeap, one for bucketAccessed() and one for run(). so the lock only need when switch -- This message was sent by Atlassian JIRA (v6.3.4#6332)