Return-Path: Delivered-To: apmail-hadoop-hbase-dev-archive@minotaur.apache.org Received: (qmail 98584 invoked from network); 22 Oct 2009 17:19:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 22 Oct 2009 17:19:22 -0000 Received: (qmail 62872 invoked by uid 500); 22 Oct 2009 17:19:22 -0000 Delivered-To: apmail-hadoop-hbase-dev-archive@hadoop.apache.org Received: (qmail 62837 invoked by uid 500); 22 Oct 2009 17:19:22 -0000 Mailing-List: contact hbase-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hbase-dev@hadoop.apache.org Delivered-To: mailing list hbase-dev@hadoop.apache.org Received: (qmail 62827 invoked by uid 99); 22 Oct 2009 17:19:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Oct 2009 17:19:22 +0000 X-ASF-Spam-Status: No, hits=-10.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Oct 2009 17:19:20 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id C2848234C498 for ; Thu, 22 Oct 2009 10:18:59 -0700 (PDT) Message-ID: <1108114702.1256231939795.JavaMail.jira@brutus> Date: Thu, 22 Oct 2009 17:18:59 +0000 (UTC) From: "stack (JIRA)" To: hbase-dev@hadoop.apache.org Subject: [jira] Commented: (HBASE-1927) Scanners not closed properly in certain circumstances (memory leak) In-Reply-To: <1309577882.1256196779387.JavaMail.jira@brutus> 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/HBASE-1927?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12768765#action_12768765 ] stack commented on HBASE-1927: ------------------------------ +1 for branch and trunk. Thanks Erik for the fix. > Scanners not closed properly in certain circumstances (memory leak) > ------------------------------------------------------------------- > > Key: HBASE-1927 > URL: https://issues.apache.org/jira/browse/HBASE-1927 > Project: Hadoop HBase > Issue Type: Bug > Components: regionserver > Affects Versions: 0.20.1 > Reporter: Erik Rozendaal > Assignee: Jonathan Gray > Fix For: 0.20.2, 0.21.0 > > Attachments: HBASE-1927-v1.patch > > > Scanners are sometimes leaked by the KeyValueHeap class. The constructor adds each scanner to a heap, but only if the scanner's peek() method returns not null (line 58). Otherwise the scanner is dropped without being closed. > Unfortunately some scanners (like StoreScanner and MemStoreScanner) register themselves to some global list when constructed and only deregister on close(). This can cause a memory leak, for example with MemStoreScanners on an empty memory store. > The quick fix is to add an else clause to the if on line 58: > } else { > scanner.close() > } > The root cause is that ownership of the scanners is transferred from the caller to the KeyValueHeap on construction. Maybe this should be made clear in the documentation or changed. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.