csgillespie / benchmarkme

Crowd sourced benchmarking
https://csgillespie.github.io/benchmarkme/
40 stars 13 forks source link

get_ram() reports incorrect RAM on Windows #31

Closed daattali closed 4 years ago

daattali commented 4 years ago

On my Windows machine with 8GB RAM I'm getting the following

> benchmarkme::get_ram()
8.2 MB

This is either the algorithm being way off, or perhaps it's a units issue and that 8.2 is just supposed to be GB instead of MB

daattali commented 4 years ago

I think the latter might be the case. Looking into benchmarkme:::get_windows_ram I see that it calls system("grep MemTotal /proc/meminfo", intern = TRUE), and the result of that for me is

> system("grep MemTotal /proc/meminfo", intern = TRUE)
[1] "MemTotal:        8203696 kB"

8203696 kB = 8.2GB

csgillespie commented 4 years ago

I think that https://github.com/csgillespie/benchmarkme/blob/master/R/get_ram.R#L5 should fix this.

Thanks. About to push to CRAN in a day.