Learn R Programming

BigDataStatMeth (version 2.0.3)

get_total_ram: Get total system RAM

Description

Returns the total physical RAM installed in the system.

Usage

get_total_ram()

Arguments

Value

Numeric value with total RAM in gigabytes (GB)

Details

This function queries the operating system to determine total RAM. Works on Windows, Linux, and macOS.

The value returned is the physical RAM available to the system:

  • On physical machines: actual installed RAM

  • On virtual machines: RAM allocated to the VM

  • On containers: RAM limit set for the container

See Also

get_available_ram, get_cpu_cores

Examples

Run this code
# \donttest{
# Check total RAM
total <- get_total_ram()
cat("System has", total, "GB of RAM\n")

# Returns 16.0 on a 16GB system
# }

Run the code above in your browser using DataLab