Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 87DDF4FD6 for ; Wed, 25 May 2011 20:56:28 +0000 (UTC) Received: (qmail 27667 invoked by uid 500); 25 May 2011 20:56:28 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 27645 invoked by uid 500); 25 May 2011 20:56:28 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 27635 invoked by uid 99); 25 May 2011 20:56:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 May 2011 20:56:28 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 May 2011 20:56:27 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 4ED4CDEE60 for ; Wed, 25 May 2011 20:55:47 +0000 (UTC) Date: Wed, 25 May 2011 20:55:47 +0000 (UTC) From: "Dan LaRocque (JIRA)" To: commits@cassandra.apache.org Message-ID: <808935524.43212.1306356947319.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <284280934.43206.1306356827355.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (CASSANDRA-2708) memory leak in CompactionManager's estimatedCompactions 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/CASSANDRA-2708?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Dan LaRocque updated CASSANDRA-2708: ------------------------------------ Comment: was deleted (was: Adding my 3-line patch against cassandra-0.7 r1127675) > memory leak in CompactionManager's estimatedCompactions > ------------------------------------------------------- > > Key: CASSANDRA-2708 > URL: https://issues.apache.org/jira/browse/CASSANDRA-2708 > Project: Cassandra > Issue Type: Bug > Components: Core > Affects Versions: 0.7.6 > Reporter: Dan LaRocque > Priority: Minor > > CompactionManager's estimatedCompactions map seems to hold all or most ColumnFamilyStores in the system as keys. Keys are never removed from estimatedCompactions. > I have a project that embeds Cassandra as a storage backend. Some of my integration tests create and drop a single keyspace and pair of column families a hundred or 150 times in one JVM. These tests always OOM'd. Loading some near-death heapdumps in mat suggested CompactionManager's estimatedCompactions held over 80% of total heap via its ColumnFamilyStore keys. estimatedCompactions had the only inbound reference to these CFSs, and the CFSs themselves had invalid = true. > As a workaround, I changed estimatedCompactions to a WeakReference-keyed map (using Guava MapMaker). My integration tests no longer OOM. > I'm generally unfamiliar with Cassandra's guts. I don't know whether weak referencing the keys of estimatedCompactions is correct (or ideal). But, that did seem to confirm my guess that retained references to dead CFSs in estimatedCompactions were swamping my heap after lots of Keyspace+ColumnFamily drops. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira