---
name: "pmNoMem"
section: "3"
platform: "linux"
package: "pcp"
version: "7.2.2-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/pmNoMem"
---

# pmNoMem(3)

report out of memory conditions

## NAME

**pmNoMem** - report out of memory conditions

## C SYNOPSIS

**#include \<pcp/pmapi.h\>**

**void pmNoMem(const char \****where***, size\_t** *size***, int** *fatal***);**

**cc ... -lpcp**

## DESCRIPTION

**pmNoMem** is a convenience method that may be used when [**malloc**(3)](/malloc/3.md) or a related memory allocation service fails.

A standard message is emitted using [**pmNotifyErr**(3)](/pmNotifyErr/3.md) with *where* used as a message prefix and the failing allocation *size* is also reported.

If *fatal* is zero (and **PM\_RECOV\_ERR** is zero), **pmNoMem** returns (the allocation failure is assumed to be recoverable by the caller), else (and **PM\_FATAL\_ERR** is a good value to use in this case) [**exit**(2)](/exit/2.md) is called with an argument of 1.

## SEE ALSO

[**exit**(2)](/exit/2.md), [**malloc**(3)](/malloc/3.md), [**PMAPI**(3)](/PMAPI/3.md) and [**pmNotifyErr**(3)](/pmNotifyErr/3.md).
