---
name: "libuvmem"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/libuvmem"
---

# libuvmem(3)

userspace general purpose resource allocator

## NAME

**libuvmem** – userspace general purpose resource allocator

## SYNOPSIS

library “libuvmem”

**#include \<sys/vmem.h\>**

## DESCRIPTION

The **libuvmem** is a general purpose resource allocator. It is a port of the kernel facility of the similar name **vmem**.

Refer to the description of the kernel allocator [vmem(9)](/vmem/9.md) to get the documentation for it.

## NOTES

The “quantum cache” feature is not implemented for userspace, and the *quantum* and *qcache\_max* arguments of the **vmem\_create**() function are ignored.

The library internally uses [malloc(3)](/malloc/3.md) to allocate structures tracking allocations.

The allocator is thread-safe. Locks for separate **vmem's** are independent between each other.

The supported *flags* for the **vmem\_xalloc**() function are

- M\_NOWAIT

- M\_FIRSTFIT

- M\_BESTFIT

- M\_NEXTFIT

## AUTHORS

See [vmem(9)](/vmem/9.md) for the history of the kernel allocator.

The userspace port for FreeBSD was done by Konstantin Belousov ⟨*kib@FreeBSD.org*⟩.
