# OS_GetTotalOccupiedSize

## C Specification

      #include <nitro/os.h>

      u32 OS_GetTotalOccupiedSize( OSArenaId id, OSHeapHandle heap );

## Arguments

id | Arena ID of the arena for the heap from which the total size is obtained
heap | Heap handle of the heap from which the total size is obtained

## Return Values

The total size (in bytes) of the memory blocks allocated to the heap. Header is included.

## Description

This function obtains the total size of the memory blocks allocated to the heap.

Set `OS_CURRENT_HEAP_HANDLE` in heap to specify the current heap.

The memory block headers are included in the size value. The size refers to the header size and the data regions. When the header cannot be included, use `OS_GetTotalAllocSize()` .

All allocated blocks are tracked down and calculated, so the time required for the process is proportional to the amount of memory blocks.

## See Also

`OS_InitAlloc, OS_GetTotalFreeSize, OS_GetMaxFreeSize
OS_GetTotalAllocSize
`

## Revision History

10/07/2005 Initial version.