-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
fix physical memory detection on OSX #15405
fix physical memory detection on OSX #15405
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I couldn't find any documentation on memsize_usable. do you know of any?
examples/bin/start-druid-main.py
Outdated
@@ -394,7 +394,7 @@ def convert_total_memory_string(memory): | |||
physical_memory = get_physical_memory() | |||
|
|||
if physical_memory is None: | |||
raise ValueError('Please specify memory argument') | |||
raise ValueError('Could not automatically determine memory size. Please explitly specify the memory argument as --memory=<integer_value><m/g>') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: spelling explicitly
No idea what |
* fix physical memory detection on OSX * typo
* fix physical memory detection on OSX * typo
I just upgraded my Mac to MacOS Sonoma and I am unable to start Druid with
bin/start-druid
This is due to the fact that the starter script can not detect the physical memory on my machine.
The physical memory is detected by doing
sysctl -a | grep hw.memsize
which for me now returns 2 values:I am guessing that "hw.memsize_usable" was added in MacOS Sonoma as previously it worked.
The script then does a
split(':')
which for me produces['hw.memsize', ' 68719476736\nhw.memsize_usable', ' 68719476736\n']
and the
[1]
index can not be parsed as a number.I am fixing this by instead greping for
sysctl -a | grep hw.memsize:
the added:
means that it should only match one line and is generally more robust.I also rewrote the error message to be better, the original
Please specify memory argument
was accurate but confused me.