---
name: "pmnomem"
section: "3"
platform: "linux"
package: "libpcp3-dev"
version: "4.3.2+really4.3.1-0.1"
release: "Debian 10 (Buster)"
platforms: ["linux"]
url: "https://new.carta.tech/pmNoMem"
---

# pmnomem(3)

report out of memory conditions

Part of [pmNoMem(3)](/pmNoMem/3.md).

## 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).
