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 <thol...@wetafx.co.nz> 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<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.

Reply via email to