Fix call to free to check memory requirements, updates #1167, fix #1166 #1173

Merged
merged 2 commits into from Oct 3, 2012

Projects

None yet

2 participants

@lemoinem
Member
lemoinem commented Oct 1, 2012

This call was introduced by @mpapis in aac1b34.
And the result use was lost while transfering requirements check from notes to
requirements in c6e79b3 (by @ddd).

In #1166, @shhhhh noticed that the check was giving an error message on OpenBSD
(and more generally, systems without free installed).

This commit reintroduce the lost check, as requested by @mpapis in #1167, and fix the error message.

@lemoinem lemoinem Fix call to free to check memory requirements, updates #1167, fix #1166
This call was introduced by mpapis in aac1b34.
And the result use was lost while transfering requirements check from notes to
requirements in c6e79b3 (by @ddd).

In #1166, @shhhhh noticed that the check was giving an error message on OpenBSD
(and more generally, systems without `free` installed).

This commit reintroduce the lost check and fix the error message.
3fac8e3
Owner
mpapis commented Oct 3, 2012

did some digging and it appears that this one will give us bytes:

sysctl hw.physmem 2>/dev/null | cut -f 2 -d =

if we call free -b then we have bytes so we could translate 600MB to 629145600B - then no calculations are needed, just comparison.

Member
lemoinem commented Oct 3, 2012

On my system I get:

mlemoine@my-server ~ $ sysctl hw.physmem
sysctl: cannot stat /proc/sys/hw/physmem: No such file or directory

So I think it's better to stick with free. I don't understand the point about free -b, we don't have any calculation right now... just a comparison...

Oh Sorry... I guess I just got it... you mean sysctl is going to work on OpenBSD, if we use it then we need to switch to free -b?

If that's it, I'll add the fallback to sysctl in an additional commit later.

@lemoinem
Owner

Tested on OpenBSD and ArchLinux (with and without free).

@mpapis mpapis merged commit e586930 into rvm:master Oct 3, 2012

1 check passed

default The Travis build passed
Details
@mpapis mpapis was assigned Oct 3, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment