powered by
Returns the total physical RAM installed in the system.
get_total_ram()
Numeric value with total RAM in gigabytes (GB)
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
get_available_ram, get_cpu_cores
get_available_ram
get_cpu_cores
# \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