vm_stat_available_mb: Available megabytes implied by a block of 'vm_stat' output

View source: R/matching_memory.R

vm_stat_available_mbR Documentation

Available megabytes implied by a block of vm_stat output

Description

Inactive and speculative pages are reclaimed on demand, so they count as available to an allocation in the same sense as Linux's MemAvailable; macOS keeps almost nothing on the free list, so the free count alone understates what a large matrix can actually obtain.

Usage

vm_stat_available_mb(vm, page_size)

Arguments

vm

Character vector of vm_stat output lines.

page_size

Page size in bytes, as returned by vm_stat_page_size().

Details

Split from get_free_ram_mb() so the page-size and page-class handling can be checked without a macOS host.

Value

Numeric scalar (MB available), or NA_real_ if unparseable.


couplr documentation built on Sept. 17, 2026, 1:08 a.m.