csgillespie / benchmarkme

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

`get_ram` not working on Windows 10 #25

Closed xiaodaigh closed 4 years ago

xiaodaigh commented 5 years ago

When I run get_ram it returns NA B.

Here is my sessionInfo()

R version 3.5.3 (2019-03-11)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17763)

Matrix products: default

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_3.5.3 tools_3.5.3   
csgillespie commented 4 years ago

Could you run

system("wmic MemoryChip get Capacity", intern=TRUE)

and tell me what that returns?

xiaodaigh commented 4 years ago

"Capacity \r" "17179869184 \r" "17179869184 \r" "17179869184 \r" "17179869184 \r" "\r"

csgillespie commented 4 years ago

Thanks. Do you 16Gb of RAM or 4 * 16GB?

xiaodaigh commented 4 years ago

4 * 16G

tylerburleigh commented 4 years ago

I also get NA B and system("wmic MemoryChip get Capacity", intern=TRUE) returns [1] "Capacity \r" "4294967296 \r" "4294967296 \r" "\r". My machine has 8GB, so 2x4GB chips.

xiaodaigh commented 4 years ago

this works for me

system('grep MemTotal /proc/meminfo', intern = TRUE)
l = strsplit(a, " ")[[1]]
l = as.numeric(l[length(l)-1])
ram_size = l/1024^2

In fact, I have used this in the disk.frame package.

csgillespie commented 4 years ago

@xiaodaigh Does that work under windows 7 and 10?

xiaodaigh commented 4 years ago

Windows 10 but haven't tested on Windows 7.

csgillespie commented 4 years ago

Thanks everyone. I've added the method proposed by @xiaodaigh and used the previous method as a fallback.

jonathonkuntz commented 4 years ago

I am also having the same problem where Get_ram() produces “NA B”

I used your code:

system("wmic MemoryChip get Capacity", intern=TRUE)

With an output of:

"Capacity \r" "17179869184 \r" "17179869184 \r" “\r”

This checks out since I have two 16 gb chips.

wiesehahn commented 3 years ago

I run into the same problem under windows 10 with package version 1.0.7

gxc251 commented 3 years ago

Same here under Windows 10, package version 1.0.7, and R version 4.1.0 system("wmic MemoryChip get Capacity", intern=TRUE) [1] "Capacity \r" "17179869184 \r" "17179869184 \r" "\r" get_ram() NA B