# enableAllocationCallstacks

> Enables the recording of callstacks for managed allocations.

## Definition

* **Type:** Property
* **Namespace:** [UnityEngine.Profiling](/engine/6000.0/script-reference/unityengine/profiling.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public static bool enableAllocationCallstacks { get; set; }
```

### Remarks

When enabled, the Unity player saves callstack for each managed allocation sample which is known as *GC.Alloc*. You can see the callstacks in the Timeline View or in the Object Details pane of the Hierarchy View when selecting the *GC.Alloc* sample.

You must also set [Profiler.enabled](/engine/6000.0/script-reference/unityengine/profiling/profiler/enabled.md) to `true` in order to start the capture.

```csharp
using UnityEngine;
using System.Collections;
using UnityEngine.Profiling;

public class ExampleClass : MonoBehaviour
{
    void Start()
    {
        Profiler.logFile = "mylog"; //Also supports passing "myLog.raw"
        Profiler.enableBinaryLog = true;
        Profiler.enableAllocationCallstacks = true;
        Profiler.enabled = true;

        // Optional, if more memory is needed for the buffer
        Profiler.maxUsedMemory = 256 * 1024 * 1024;
    }
}
```

**Note:** Callstacks capture adds noticable performance overhead to the profiling for every managed allocation.
