# CheckForLeaks()

> Gets a list of memory leaks.

## Definition

* **Type:** Method
* **Namespace:** [Unity.Collections.LowLevel.Unsafe](/engine/6000.0/script-reference/unity/collections/lowlevel/unsafe.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public static int CheckForLeaks()
```

### Returns

| Type                                                       | Description                |
| ---------------------------------------------------------- | -------------------------- |
| [int](https://learn.microsoft.com/dotnet/api/system.int32) | The number of leaks found. |

### Remarks

Any memory allocated before this call that hasn't already been freed, is assumed to have leaked.
