---
name: "pmfreelabelsets"
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/pmFreeLabelSets"
---

# pmfreelabelsets(3)

release storage allocated for performance metric labels

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

## NAME

**pmFreeLabelSets** - release storage allocated for performance metric labels

## C SYNOPSIS

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

**void pmFreeLabelSets(pmLabelSet \****sets***, int** *nsets***);**

**cc ... -lpcp**

## DESCRIPTION

The array of label *sets* returned by [**pmLookupLabels**(3)](/pmLookupLabels/3.md) and related APIs are allocated below the Performance Metrics Application Programming Interface (PMAPI) using a variety of calls to the system's dynamic memory allocation (i.e. [**malloc**(3)](/malloc/3.md)) interfaces.

Applications should call **pmFreeLabelSets** to release the storage previously allocated for the label *sets* array when access to the structure is no longer needed. The return value from **pmLookupLabels** indicates the number of elements in the label *sets* array, and this should be passed in using the *nsets* parameter.

Under **no** circumstances should an application use *free(labelset)* to release storage previously allocated for a *pmLabelSet* by [**pmLookupLabels**(3)](/pmLookupLabels/3.md) or related APIs.

## SEE ALSO

[**malloc**(3)](/malloc/3.md), [**PMAPI**(3)](/PMAPI/3.md) and [**pmLookupLabels**(3)](/pmLookupLabels/3.md).
