# CollectionAgeLimitAttribute Constructors

[Type overview](/orleans/docs/api/csharp/microsoft.orleans.core/orleans.collectionagelimitattribute/)

## CollectionAgeLimitAttribute {#constructor-a9765cf1}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core/orleans.collectionagelimitattribute/constructors/constructor-a9765cf1/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core/Configuration/CollectionAgeLimitAttribute.cs#L22)

```csharp
public CollectionAgeLimitAttribute()
```

Specifies the period of inactivity before a grain is available for collection and deactivation.

## CollectionAgeLimitAttribute(string) {#constructor-string-2340eda5}

[Dedicated page](/orleans/docs/api/csharp/microsoft.orleans.core/orleans.collectionagelimitattribute/constructors/constructor-string-2340eda5/)

[Source](https://github.com/dotnet/orleans/blob/e4e752cedecc2976811db49802c7a999b1f1c704/src/Orleans.Core/Configuration/CollectionAgeLimitAttribute.cs#L28)

```csharp
public CollectionAgeLimitAttribute(string inactivityPeriod)
```

Specifies the period of inactivity before a grain is available for collection and deactivation.

### Parameters

- `inactivityPeriod` (`string`): The period of inactivity before a grain is available for collection and deactivation, expressed as a string using `System.TimeSpan.Parse(System.String)` syntax.
