---
title:  gc
---

<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements.  See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License.  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

Force GC (Garbage Collection) on a member or members.

The default is for garbage collection to occur on all caching members.

The **gfsh gc** command should be used only in non-production environments.
This is a forced GC event and not always handled well by the garbage collector outside of normal GC processing.
This can cause slow-responding members to be perceived as unresponsive and disconnected from the cluster.

**Availability:** Online. You must be connected in `gfsh` to a JMX Manager member to use this command.

**Syntax:**

``` pre
gc [--groups=value(,value)*] [--member=value]
```

<a id="concept_95E57FE81F5244FB810C58816212323E__table_dz5_bbh_2w"></a>

| Name                                           | Description                                                                 |
|------------------------------------------------|-----------------------------------------------------------------------------|
| <span class="keyword parmname">&#8209;&#8209;groups</span>  | One or more group(s) of members on which garbage collection will be forced. |
| <span class="keyword parmname">&#8209;&#8209;member</span> | Name/ID of the member on which garbage collection will be forced.           |

<span class="tablecap">Table 1. GC Parameters</span>

**Example Commands:**

``` pre
gc --member=server1
gc --groups=Group1
gc
```

**Sample Output:**

``` pre
gfsh>gc
Sucessfully executed GC
```


