Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5F2B8D838 for ; Fri, 31 Aug 2012 16:51:32 +0000 (UTC) Received: (qmail 71713 invoked by uid 500); 31 Aug 2012 16:51:29 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 71692 invoked by uid 500); 31 Aug 2012 16:51:29 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 71682 invoked by uid 99); 31 Aug 2012 16:51:29 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 31 Aug 2012 16:51:29 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FSL_RCVD_USER,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jeffpk@gmail.com designates 209.85.214.172 as permitted sender) Received: from [209.85.214.172] (HELO mail-ob0-f172.google.com) (209.85.214.172) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 31 Aug 2012 16:51:21 +0000 Received: by obbwc20 with SMTP id wc20so6638302obb.31 for ; Fri, 31 Aug 2012 09:51:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=2plrwpNNPDVid9G2bRw+NvZi/z6DndoJrfO6UXAAbRc=; b=Rr1jMUHV81kPwVy3lcwkr6XTkKP5Z+EsKBT8yYqzk9NrPmx9gCoHAnsEUyDnOoeCu0 LMttDJ4TPpkP7EzZwDbQue4yTlDqJ8Gf73nYj1arktosZlAD+dfEq1S6RJ7B7vsGkX3t 1qydqRs9RfoyjdJP+awMKh7ZIfwnXv6XVSs86p7mf8939o+yOGZItimEkFODr9bnnyzg Lo2EOy1oA6DSobIxEgkHecXWBjW4esgbP1RTtdI+3C1H5zQ3sFtMaGRg4qLXfnVVLJl8 88raiZJ7JD/mmr1A+6a6fjh8kIF7dYyWWxWKeLpTnkfSVMN6XjJzQuueCWtJUOT8ZGCB 79cA== Received: by 10.60.172.143 with SMTP id bc15mr8729001oec.73.1346431860894; Fri, 31 Aug 2012 09:51:00 -0700 (PDT) MIME-Version: 1.0 Received: by 10.60.5.48 with HTTP; Fri, 31 Aug 2012 09:50:40 -0700 (PDT) In-Reply-To: References: From: Jeffrey Kesselman Date: Fri, 31 Aug 2012 12:50:40 -0400 Message-ID: Subject: Re: force gc? To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=bcaec54c527cc86b3b04c8929815 --bcaec54c527cc86b3b04c8929815 Content-Type: text/plain; charset=ISO-8859-1 Cassandra at least used to do disc cleanup as a side effect of garbage collection through finalizers. (This is a mistake for the reason outlined below.) It is important to understand that you can *never* "force* a gc in java. Even calling System.gc() is merely a hint to the VM. What you are doing is telling the VM that you are * willing* to give up some processor time right now to gc, how much it choses to actually collect or not collect is totally up to the VM. The *only* garbage collection guarantee in java is that it will make a "best effort" to collect what it can to avoid an out of memory exception at the time that it runs out of memory. You are not guaranteed when *if ever*, a given object will actually be collected. Since finalizers happen when an object is collected, and not when it becomes a candidate for collection, the same is true of the finalizer. You are not guaranteed when, if ever, it will run. On Fri, Aug 31, 2012 at 9:03 AM, Alexander Shutyaev wrote: > Hi All! > > I have a problem with using cassandra. Our application does a lot of > overwrites and deletes. If I understand correctly cassandra does not > actually delete these objects until gc_grace seconds have passed. I tried > to "force" gc by setting gc_grace to 0 on an existing column family and > running major compaction afterwards. However I did not get disk space back, > although I'm pretty much sure that my column family should occupy many > times fewer space. We have also a PostgreSQL db and we duplicate each > operation with data in both dbs. And the PosgreSQL table is much more > smaller than the corresponding cassandra's column family. Does anyone have > any suggestions on how can I analyze my problem? Or maybe I'm doing > something wrong and there is another way to force gc on an existing column > family. > > Thanks in advance, > Alexander > -- It's always darkest just before you are eaten by a grue. --bcaec54c527cc86b3b04c8929815 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cassandra at least used to do disc cleanup as a side effect of garbage=A0co= llection=A0through finalizers. =A0(This is a mistake for the reason=A0outli= ned=A0below.)

It is important to understand that you can= *never* "force* a gc in java. Even calling System.gc() is merely a hi= nt to the VM. What you are=A0doing=A0is telling the VM that you are *=A0wil= ling* to give up some processor=A0time=A0right now to gc, how much it chose= s to actually collect or not collect is totally up to the VM.

The *only* garbage collection=A0guarantee=A0in java is = that it will make a "best effort" to collect what it can to avoid= an out of memory exception at the time that it runs out of memory. =A0You = are not=A0guaranteed=A0when *if ever*, a given object will actually be coll= ected. =A0Since finalizers happen when an=A0object=A0is=A0collected, and no= t when it=A0becomes=A0a candidate for collection, the same is true of the f= inalizer. =A0You are not=A0guaranteed=A0when, if ever, it will run.

On Fri, Aug 31, 2012 at 9:03 AM, Alexander S= hutyaev <shutyaev@gmail.com> wrote:
Hi All!

I have a problem with using cassandra. Our appli= cation does a lot of overwrites and deletes. If I understand correctly cass= andra does not actually delete these objects until gc_grace seconds have pa= ssed. I tried to "force" gc by setting gc_grace to 0 on an existi= ng column family and running major compaction afterwards. However I did not= get disk space back, although I'm pretty much sure that my column fami= ly should occupy many times fewer space. We have also a PostgreSQL db and w= e duplicate each operation with data in both dbs. And the PosgreSQL table i= s much more smaller than the corresponding cassandra's column family. D= oes anyone have any suggestions on how can I analyze my problem? Or maybe I= 'm doing something wrong and there is another way to force gc on an exi= sting column family.

Thanks in advance,
Alexander



--
It's alw= ays darkest just before you are eaten by a grue.
--bcaec54c527cc86b3b04c8929815--