Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_ram() cannot retrieve RAM #49

Open
alemobile opened this issue Sep 19, 2023 · 1 comment
Open

get_ram() cannot retrieve RAM #49

alemobile opened this issue Sep 19, 2023 · 1 comment

Comments

@alemobile
Copy link

OS and Hardware:

OS: Windows 10, 09-2023 cumulative update (KB5030211)
Laptop Model: HP ENVY Notebook - 15-ae112nl
Processor: Intel(R) Core(TM) i7-6500U CPU @ 2.50GHz
RAM: 16 GB
R version: 4.3.1 "Beagle Scouts"
benchmarkme package version: 1.0.8

Summary

get_ram() can't retrieve RAM and reports an Error that I don't recognize.

Steps to Reproduce

  1. Run get_ram() in R Console.

Actual Result

The following Error is printed:

Error in inherits(ram, "try-error") || length(ram) == 0L || is.na(ram) : 'length = 3' in coercion to 'logical(1)'

Expected Result

The amount of RAM installed on my laptop (16 GB).

Reported by

Alessandro Mazza.

@ptompalski
Copy link
Contributor

Experienced similar issue:

get_ram()
Error in inherits(ram, "try-error") || length(ram) == 0L || is.na(ram) : 
  'length = 9' in coercion to 'logical(1)'

It seems that the cause of this error is in is.na(ram) - in my case the return values with benchmarkme:::system_ram(os)
is a vector, not a single value:

[1] "68719476736  \r" "68719476736  \r" "68719476736  \r" "68719476736  \r"
[5] "68719476736  \r" "68719476736  \r" "68719476736  \r" "68719476736  \r"
[9] "\r"    

I think is.na(ram) should be changed to any(is.na(ram)). After that change get_ram() works fine on my PC.
I will submit a PR shortly.

ptompalski added a commit to ptompalski/benchmarkme-1 that referenced this issue Apr 18, 2024
csgillespie pushed a commit that referenced this issue May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants