---
name: "TAU_TRACK_MEMORY_HEADROOM"
section: "3"
platform: "linux"
package: "tau"
version: "2.17.3.1.dfsg-4.2"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/TAU_TRACK_MEMORY_HEADROOM"
---

# TAU\_TRACK\_MEMORY\_HEADROOM(3)

Track the headroom (amount of memory for a process to grow) by periodically interrupting the program

## NAME

TAU\_TRACK\_MEMORY\_HEADROOM - Track the headroom (amount of memory for a process to grow) by periodically interrupting the program

## SYNOPSIS

**C/C++:**

**TAU\_TRACK\_MEMORY\_HEADROOM(void);**

**Fortran:**

**TAU\_TRACK\_MEMORY\_HEADROOM(void);**

## DESCRIPTION

Tracks the amount of memory available for the process before it runs out of free memory on the heap. This call sets up a signal handler that is invoked every 10 seconds by an interrupt (this interval may be altered by using the TAU\_SET\_INTERRUPT\_INTERVAL call). Inside the interrupt handler, TAU evaluates how much memory it can allocate and associates it with the callstack using the TAU context events (See [TAU\_REGISTER\_CONTEXT\_EVENT(3)](/TAU_REGISTER_CONTEXT_EVENT/3.md)). The user can vary the size of the callstack by setting the environment variable TAU\_CALLPATH\_DEPTH (default is 2). This call is useful on machines like IBM BG/L where no virtual memory (or paging using the swap space) is present. The amount of heap memory available to the program is limited by the amount of available physical memory. TAU executes a series of malloc calls with a granularity of 1MB and determines the amount of memory available for the program to grow.

## EXAMPLE

**C/C++ :**

```
TAU_TRACK_MEMORY_HEADROOM();
```

**Fortran :**

```
call TAU_TRACK_MEMORY_HEADROOM()
```

## SEE ALSO

[TAU\_TRACK\_MEMORY(3)](/TAU_TRACK_MEMORY/3.md), [TAU\_SET\_INTERRUPT\_INTERVAL(3)](/TAU_SET_INTERRUPT_INTERVAL/3.md), [TAU\_ENABLE\_TRACKING\_MEMORY\_HEADROOM(3)](/TAU_ENABLE_TRACKING_MEMORY_HEADROOM/3.md), [TAU\_DISABLE\_TRACKING\_MEMORY\_HEADROOM(3)](/TAU_DISABLE_TRACKING_MEMORY_HEADROOM/3.md), [TAU\_TRACK\_MEMORY\_HEADROOM\_HERE(3)](/TAU_TRACK_MEMORY_HEADROOM_HERE/3.md)
