PMNOMEM(3)
π PMNOMEM(3) β like, the out-of-memory reporter bestie π
okay so this one lives in the Library Functions Manual section 3, and it's giving "your malloc just fainted and someone has to tell everybody" energy π«Ά
β¨ NAME β¨
pmNoMem β report out of memory conditions π
yeah. it's the girl who shows up when the memory allocation said "not today" and tells the whole program about it.
πΈ C SYNOPSIS πΈ
#include <pcp/pmapi.h>
void pmNoMem(const char *where, size_t size, int fatal);
cc ... -lpcp
bestie you literally just include <pcp/pmapi.h>, call pmNoMem with three little args, and link against -lpcp. that's the whole vibe. slay π
π¦ DESCRIPTION π¦
so pmNoMem is a convenience method β a lil helper β and you reach for it when malloc(3) or one of its related memory allocation services just fails on you. π it's the "welp, we're out of memory" hotline.
what does it do? it emits a standard message using pmNotifyErr(3), where your where argument gets used as the message prefix π β and it also reports the failing allocation size while it's at it. so the message is like "here's where it broke, and here's how much memory we were begging for."
now for the spicy part, the fatal decision π:
- if
fatalis zero (andPM_RECOV_ERRis zero),pmNoMemjust returns β because the allocation failure is assumed to be recoverable by the caller. like, you got this, handle it, bestie. π«Ά - else β and
PM_FATAL_ERRis a good value to use in this case βexit(2)is called with an argument of1. πͺπ¨ that's the dramatic door slam. no coming back from that one.
ngl the fatal flag is literally a vibe check: recoverable era or we're exiting the building. choose wisely π
π SEE ALSO π
exit(2), malloc(3), PMAPI(3) and pmNotifyErr(3).
iykyk β those are the friends it rolls with. β¨
and that's the whole page, fr fr π β brought to you by Performance Co-Pilot (that's the PCP girlies, iconic), filed under PMNOMEM(3). go forth and report your out-of-memory moments with style ππΈβ¨
π¦ where this page comes from
- arch rolling: pcp 7.2.2-2 Β· GPL-2.0-or-later AND LGPL-2.1-or-later AND CC-BY-3.0
- centos-stream 10: pcp-doc 7.1.5-6.el10 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 43: pcp-doc 7.0.1-1.fc43 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 43: pcp-doc 7.2.1-1.fc43
- fedora 43: pcp-doc 7.2.2-1.fc43
- fedora 43: pcp-doc 7.2.2-2.fc43 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 44: pcp-doc 7.1.0-6.fc44 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 44: pcp-doc 7.2.1-1.fc44
- fedora 44: pcp-doc 7.2.2-1.fc44
- fedora 44: pcp-doc 7.2.2-2.fc44 Β· GPL-2.0-or-later AND CC-BY-3.0
- ubuntu resolute: libpcp4-dev 7.1.1-1
- ubuntu stonking: libpcp4-dev 7.2.1-2build1
- Copyright (c) 2017 Ken McDonell. All Rights Reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms