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 B5B6A6C4F for ; Fri, 5 Aug 2011 00:22:48 +0000 (UTC) Received: (qmail 18752 invoked by uid 500); 5 Aug 2011 00:22:46 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 18636 invoked by uid 500); 5 Aug 2011 00:22:46 -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 18628 invoked by uid 99); 5 Aug 2011 00:22:45 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Aug 2011 00:22:45 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jeffpk@gmail.com designates 74.125.82.44 as permitted sender) Received: from [74.125.82.44] (HELO mail-ww0-f44.google.com) (74.125.82.44) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Aug 2011 00:22:39 +0000 Received: by wwe5 with SMTP id 5so2005306wwe.25 for ; Thu, 04 Aug 2011 17:22:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=ubaS03ejLPTFHEs0Jw3/Ynk5wESekhJkdt1UiEvUZ2I=; b=flVKLAfJ1gyP91m22SA8TplhZ3hPiwGUTtOPL6I9+caSHM0IKMr6fqMCxxx+dFUKdS GnKAWfTINLkkx552c3LiqqS5dVZbI6mI7z86XYFeozQttjZIaSHQYVrQX7Dht7B6Yqsx +kZ8y4nRCINUFlmexjx7THnllQqSMEoiX9X4I= MIME-Version: 1.0 Received: by 10.216.38.76 with SMTP id z54mr1286142wea.102.1312503739126; Thu, 04 Aug 2011 17:22:19 -0700 (PDT) Received: by 10.216.46.76 with HTTP; Thu, 4 Aug 2011 17:22:19 -0700 (PDT) In-Reply-To: <4E3B1EB8.4030206@wetafx.co.nz> References: <4E3B1EB8.4030206@wetafx.co.nz> Date: Thu, 4 Aug 2011 20:22:19 -0400 Message-ID: Subject: Re: Force a garbage collection with jmxterm from the shell From: Jeffrey Kesselman To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=0016e64549982312e504a9b717cc X-Virus-Checked: Checked by ClamAV on apache.org --0016e64549982312e504a9b717cc Content-Type: text/plain; charset=ISO-8859-1 Technically, by the VM spec, you can never *force* a java VM to garbage collect. You can request, but thats it. Rather then open that whole debate again if anyone doubts this, i suggets they look back in the archives. JK On Thu, Aug 4, 2011 at 6:35 PM, Teijo Holzer wrote: > Hi, > > The following command line triggers a garbage collection via JMX: > > echo 'run -b java.lang:type=Memory gc' | java -jar > jmxterm-1.0-alpha-4-uber.jar -l service:jmx:rmi:///jndi/rmi://**hostname:8080/jmxrmi > -n > > It uses: > > http://wiki.cyclopsgroup.org/**jmxterm > > The GC is necessary after a major compaction to trigger the deletion of > stale files. > > jmxterm can also be used to query and modify beans exposed via JMX. That > makes it easy to integrate into any monitoring & maintenance scripts, e.g.: > > echo 'get -b org.apache.cassandra.db:type=**ColumnFamilies,keyspace=KS1,**columnfamily=CF1 > ReadCount' | ... > > You can also perform multiple operations as once: > > echo 'domains\nbeans' | ... > > If you are concerned about the start-up speed of the jar, just unpack it. > You might need to unpack & shuffle the internal jars around a bit as well. > > Cheers, > > T. > -- It's always darkest just before you are eaten by a grue. --0016e64549982312e504a9b717cc Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Technically, by the VM spec, you can never *force* a java VM to garbage col= lect. =A0You can request, but thats it.

Rather then open= that=A0whole=A0debate again if=A0anyone=A0doubts this, i suggets they look= back in the archives.

JK



On Thu, Aug 4, 2011 at 6:35 PM, Teijo Holzer <tholzer@wetafx.co.nz> w= rote:
Hi,

The following command line triggers a garbage collection via JMX:

echo 'run -b java.lang:type=3DMemory gc' | java -jar jmxterm-1.0-al= pha-4-uber.jar -l service:jmx:rmi:///jndi/rmi://hostname:8080/jmxrmi= -n

It uses:

http://w= iki.cyclopsgroup.org/jmxterm

The GC is necessary after a major compaction to trigger the deletion of sta= le files.

jmxterm can also be used to query and modify beans exposed via JMX. That ma= kes it easy to integrate into any monitoring & maintenance scripts, e.g= .:

echo 'get -b org.apache.cassandra.db:type=3DColumnFamilies,keysp= ace=3DKS1,columnfamily=3DCF1 ReadCount' | ...

You can also perform multiple operations as once:

echo 'domains\nbeans' | ...

If you are concerned about the start-up speed of the jar, just unpack it. Y= ou might need to unpack & shuffle the internal jars around a bit as wel= l.

Cheers,

=A0 =A0 =A0 =A0T.



--
It's always = darkest just before you are eaten by a grue.
--0016e64549982312e504a9b717cc--