PMFREERESULT(3)
π PMFREERESULT(3) β the "bestie please clean up after yourself" page π
okay so welcome to the manual page for pmFreeResult and pmFreeHighResResult β the two little cleanup queens of the PCP world. Their whole job? Release the storage that was allocated for performance metrics values. That's it. That's the gig. And honestly? They ate. β¨
πΈ NAME πΈ
pmFreeResult, pmFreeHighResResult β release storage allocated for performance metrics values π§Ήπ«Ά
β¨ C SYNOPSIS β¨
#include <pcp/pmapi.h>
void pmFreeResult(pmResult *result);
void pmFreeHighResResult(pmHighResResult *result);
cc ... -lpcp
no cap, that's the whole signature. no return value. no drama. she just frees and dips. π
π¦ DESCRIPTION π¦
Okay bestie, listen up, this part matters.
The variable sized results that come back from pmFetch(3) and pmFetchHighRes(3) are allocated below the Performance Metrics Application Programming Interface (PMAPI) using a combo of dynamic allocation (that's malloc(3), the classic) and some specialized allocation strategies. So like, it's not just one boring malloc situation, it's giving layered. π
So when your app is done peeking at that pmResult structure and genuinely no longer needs access to it, you call pmFreeResult to release the storage that was previously allocated for result by pmFetch(3). That's the move. That's the whole vibe. π
β οΈ UNDER NO CIRCUMSTANCES should an application usefree(result)to release storage previously allocated for apmResultbypmFetch(3). Like. Do not. I am begging. π That is not it, bestie β it's a whole different allocation strategy situation and free() does not know her.
Similarly, memory allocated for the high resolution timestamped result structure that comes back from pmFetchHighRes(3) should be released by a call to pmFreeHighResResult. Same energy, different struct. β
So basically: you fetched it, you free it β but you free it with her function, not with plain old free(). iykyk. π
π SEE ALSO π
and that's the page, bestie!! πβ¨ this icon was brought to you by Performance Co-Pilot (that's the PCP girlies π«Ά), sittin' pretty on the PCP manual, filed under PMFREERESULT(3) β go free your results, not your vibes. π
π
π¦ where this page comes from
- centos-stream 9: pcp-doc 6.3.7-14.el9 Β· GPL-2.0-or-later AND CC-BY-3.0
- debian trixie: libpcp3-dev 6.3.8-1
- opensuse-leap 16.0: pcp-doc 6.2.0-160000.4.1 Β· GPL-2.0+ AND CC-BY-SA-3.0
- ubuntu noble: libpcp3-dev 6.2.0-1.1build4
- ubuntu questing: libpcp3-dev 6.3.8-1
- Copyright (c) 2000-2004 Silicon Graphics, Inc. All Rights Reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms