Return-Path: X-Original-To: apmail-geode-issues-archive@minotaur.apache.org Delivered-To: apmail-geode-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 9939618C6B for ; Fri, 8 Jan 2016 04:40:48 +0000 (UTC) Received: (qmail 10566 invoked by uid 500); 8 Jan 2016 04:40:48 -0000 Delivered-To: apmail-geode-issues-archive@geode.apache.org Received: (qmail 10266 invoked by uid 500); 8 Jan 2016 04:40:48 -0000 Mailing-List: contact issues-help@geode.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@geode.incubator.apache.org Delivered-To: mailing list issues@geode.incubator.apache.org Received: (qmail 9768 invoked by uid 99); 8 Jan 2016 04:40:48 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Jan 2016 04:40:48 +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 87A2AC1244 for ; Fri, 8 Jan 2016 04:40:47 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.779 X-Spam-Level: * X-Spam-Status: No, score=1.779 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001] autolearn=disabled Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id aqIn_GcdkuEc for ; Fri, 8 Jan 2016 04:40:47 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with SMTP id B429443A0F for ; Fri, 8 Jan 2016 04:40:46 +0000 (UTC) Received: (qmail 6594 invoked by uid 99); 8 Jan 2016 04:40:46 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Jan 2016 04:40:46 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 434C82C14F4 for ; Fri, 8 Jan 2016 04:40:46 +0000 (UTC) Date: Fri, 8 Jan 2016 04:40:46 +0000 (UTC) From: "Anthony Baker (JIRA)" To: issues@geode.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (GEODE-488) OffHeapMemoryMonitor deliverNextAbnormalEvent logic needs review MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/GEODE-488?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Anthony Baker updated GEODE-488: -------------------------------- Fix Version/s: 1.0.0-alpha1 > OffHeapMemoryMonitor deliverNextAbnormalEvent logic needs review > ---------------------------------------------------------------- > > Key: GEODE-488 > URL: https://issues.apache.org/jira/browse/GEODE-488 > Project: Geode > Issue Type: Task > Reporter: Darrel Schneider > Assignee: Darrel Schneider > Fix For: 1.0.0-alpha1 > > > OffHeapMemoryMonitor deliverNextAbnormalEvent logic needs review. > It looks like we set it to true but then don't call updateStateAndSendEvent which is the only code that uses it. > It only uses it if the amount of off-heap memory has changed. > The original intent of it was to deliver an event if the amount of memory has changed but the non-normal state has not. > This code might be ok; it just needs review. > {code} > while (!this.stopRequested) { > updateStateAndSendEvent(lastOffHeapMemoryUsed); > synchronized (this) { > if (lastOffHeapMemoryUsed == this.offHeapMemoryUsed && !this.stopRequested) { > try { > do { > this.wait(1000); > if (this.offHeapMemoryUsed == lastOffHeapMemoryUsed) { > // The wait timed out. So tell the OffHeapMemoryMonitor > // that we need an event if the state is not normal. > deliverNextAbnormalEvent(); > // TODO: don't we need a "break" here? > // As it is we set deliverNextAbnormalEvent > // but then go back to sleep in wait. > // We need to call updateStateAndSendEvent > // which tests deliverNextAbnormalEvent. > // But just adding a break is probably not enough. > // We only set deliverNextAbnormalEvent if the wait > // timed out which means that the amount of offHeapMemoryUsed > // did not change. > // But in updateStateAndSendEvent we only deliver an > // abnormal event if the amount of memory changed. > // This code needs to be reviewed with Swapnil but > // it looks to Darrel like deliverNextAbnormalEvent > // can be removed. > } else { > // we have been notified so exit the inner while loop > // and call updateStateAndSendEvent. > lastOffHeapMemoryUsed = this.offHeapMemoryUsed; > break; > } > } while (true); > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)