get_memory_thresholds: Get dynamic memory thresholds based on system RAM

View source: R/memory_utils.R

get_memory_thresholdsR Documentation

Get dynamic memory thresholds based on system RAM

Description

Calculates appropriate memory thresholds for conversions based on total system RAM. Returns conservative values suitable for most systems.

Usage

get_memory_thresholds(total_ram = NULL)

Arguments

total_ram

Numeric. Total system RAM in GB. If NULL (default), auto-detects using C++ implementation.

Details

Calculation logic:

Uses percentage of total RAM with safety margins:

  • Silent: 15\

  • Warning: 30\

  • Force: 50\

  • Blocked: 80\

Fallback values (if RAM detection fails):

  • Silent: 2 GB

  • Warning: 4 GB

  • Force: 8 GB

  • Blocked: 16 GB

Value

Named list with thresholds in MB:

silent

Size below which conversions happen silently

warning

Size requiring user confirmation

force

Size requiring force=TRUE

blocked

Size that cannot be converted

See Also

get_total_ram, memory_info

Examples


# Auto-detect
thresholds <- get_memory_thresholds()
# $silent: 3000 MB, $warning: 8000 MB, etc.

# Manual specification (e.g., for 32GB system)
thresholds <- get_memory_thresholds(total_ram = 32)



BigDataStatMeth documentation built on May 15, 2026, 1:07 a.m.