# ValidateHeap()

> Scans the managed heap to check for corrupted objects.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.Diagnostics](/engine/6000.6/script-reference/unityengine/diagnostics.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public static void ValidateHeap()
```

### Remarks

This function only works when you use the Mono scripting backend. If this function discovers a corrupted object, the editor log displays a callstack and the Editor crashes, either through a fatal native assert or an access violation within Mono. Use this function to find memory corruption closer to when it occurs.
