---
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.

**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">\\-\\-groups</span>  | One or more group(s) of members on which garbage collection will be forced. |
| <span class="keyword parmname">\\-\\-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
```


