---
name: "ksize"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/ksize"
---

# ksize(9)

get the actual amount of memory allocated for a given object

## NAME

ksize - get the actual amount of memory allocated for a given object

## SYNOPSIS

**size\_t ksize(const void \*** *objp***);**

## ARGUMENTS

*objp*

Pointer to the object

## DESCRIPTION

kmalloc may internally round up allocations and return more memory than requested. **ksize** can be used to determine the actual amount of memory allocated. The caller may use this additional memory, even though a smaller amount of memory was initially specified with the kmalloc call. The caller must guarantee that objp points to a valid object previously allocated with either **kmalloc** or **kmem\_cache\_alloc**. The object must not be freed during the duration of the call.

## COPYRIGHT
