# OS_GetMaxFreeSize

## Syntax

      #include <nitro/os.h>

      u32 OS_GetMaxFreeSize( OSArenaId id, OSHeapHandle heap );

## Arguments

id | Arena ID of the arena for the heap from which the largest block is obtained
heap | Heap handle of the heap from which the largest block is obtained

## Return Values

The size (in bytes) of the largest free block in the heap.

## Description

Obtains the size of the largest free block in heaps.

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

The free block's header is not included in the size value. The size refers to the free block's data region.

All free 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_GetTotalAllocSize, OS_GetTotalFreeSize`

## Revision History

2004/11/05 Initial version.

CONFIDENTIAL