# TrimExcess()

> Sets the capacity to match what it would be if it had been originally initialized with all its entries.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Collections](/engine/6000.7/script-reference/unity/collections.md)
* **Assembly:** UnityEngine.ManagedKernelModule

```csharp
public void TrimExcess()
```
