Ohai: ever needed to get memory info on mac os x?


#1

Now you can!

I submitted this ticket a while back, with a fix provided, and I’m eager to
get it merged into Ohai:

http://tickets.opscode.com/browse/OHAI-431

Can anyone see anything glaring that would prevent it from getting merged
in?

Cheers,
Pat


Patrick Collins


#2

Although that works, I’d try to implement it using vm_stat instead. Top
produces a lot of unnecessary output and it’s a bit slow.

Looks like someone was able to grab some of the info you need from vm_stat:

http://vigodome.com/blog/2012/01/27/show-free-memory-on-osx/

On Fri, Mar 22, 2013 at 4:05 PM, Pat Collins pat@burned.com wrote:

Now you can!

I submitted this ticket a while back, with a fix provided, and I’m eager
to get it merged into Ohai:

http://tickets.opscode.com/browse/OHAI-431

Can anyone see anything glaring that would prevent it from getting merged
in?

Cheers,
Pat


Patrick Collins


#3

Yeah I feel like I tried that route but ended up getting unreliable numbers (figures that didn’t match what was coming from Activity Monitor.)

You’re right that top is slow. I’ll try it with your suggestion and see if I’m remembering correctly.

Pat


Patrick Collins

On Mar 22, 2013, at 4:20 PM, Graham McMillan gmcmillan@site5.com wrote:

Although that works, I’d try to implement it using vm_stat instead. Top produces a lot of unnecessary output and it’s a bit slow.

Looks like someone was able to grab some of the info you need from vm_stat:

http://vigodome.com/blog/2012/01/27/show-free-memory-on-osx/

On Fri, Mar 22, 2013 at 4:05 PM, Pat Collins pat@burned.com wrote:

Now you can!

I submitted this ticket a while back, with a fix provided, and I’m eager to get it merged into Ohai:

http://tickets.opscode.com/browse/OHAI-431

Can anyone see anything glaring that would prevent it from getting merged in?

Cheers,
Pat


Patrick Collins


#4

OK, pushed a new version that depends on sysctl and vm_stat, and included a
unit test:

It implements: “total”, “active”, “inactive”, “free”. I wanted to keep the
semantics the same as other platforms, so “active” includes both "wired"
and “active” numbers that you see in Activity Monitor. This has the
distinct advantage that:: active + inactive + free = total

(The term “wired” seems to apply only to Darwin memory management, and
means memory that will almost always stay in memory and will not be
transferred to disk. This definitely counts as active memory in my book,
hence my choice to include it in “active”.)

The ticket is here:

http://tickets.opscode.com/browse/OHAI-431

Thanks Graham, for your help in tracking down a faster way to implement.
Also thanks Lamont for the vm_stat tip.

As always any comments, q’s let me know.

Cheers,
Pat

On Sat, Mar 23, 2013 at 9:17 AM, Pat Collins pat@burned.com wrote:

Yeah I feel like I tried that route but ended up getting unreliable
numbers (figures that didn’t match what was coming from Activity Monitor.)

You’re right that top is slow. I’ll try it with your suggestion and see if
I’m remembering correctly.

Pat


Patrick Collins

On Mar 22, 2013, at 4:20 PM, Graham McMillan gmcmillan@site5.com wrote:

Although that works, I’d try to implement it using vm_stat instead. Top
produces a lot of unnecessary output and it’s a bit slow.

Looks like someone was able to grab some of the info you need from vm_stat:

http://vigodome.com/blog/2012/01/27/show-free-memory-on-osx/

On Fri, Mar 22, 2013 at 4:05 PM, Pat Collins pat@burned.com wrote:

Now you can!

I submitted this ticket a while back, with a fix provided, and I’m eager
to get it merged into Ohai:

http://tickets.opscode.com/browse/OHAI-431

Can anyone see anything glaring that would prevent it from getting merged
in?

Cheers,
Pat


Patrick Collins


Patrick Collins


#5

Hi Opscode folks,

Is there a reason why this enhancement can’t be merged into Ohai?


http://tickets.opscode.com/browse/OHAI-431

Cheers,
Pat

On Mon, Mar 25, 2013 at 12:56 PM, Pat Collins pat@burned.com wrote:

OK, pushed a new version that depends on sysctl and vm_stat, and included
a unit test:

https://github.com/opscode/ohai/pull/119/files

It implements: “total”, “active”, “inactive”, “free”. I wanted to keep the
semantics the same as other platforms, so “active” includes both "wired"
and “active” numbers that you see in Activity Monitor. This has the
distinct advantage that:: active + inactive + free = total

(The term “wired” seems to apply only to Darwin memory management, and
means memory that will almost always stay in memory and will not be
transferred to disk. This definitely counts as active memory in my book,
hence my choice to include it in “active”.)

The ticket is here:

http://tickets.opscode.com/browse/OHAI-431

Thanks Graham, for your help in tracking down a faster way to implement.
Also thanks Lamont for the vm_stat tip.

As always any comments, q’s let me know.

Cheers,
Pat

On Sat, Mar 23, 2013 at 9:17 AM, Pat Collins pat@burned.com wrote:

Yeah I feel like I tried that route but ended up getting unreliable
numbers (figures that didn’t match what was coming from Activity Monitor.)

You’re right that top is slow. I’ll try it with your suggestion and see
if I’m remembering correctly.

Pat


Patrick Collins

On Mar 22, 2013, at 4:20 PM, Graham McMillan gmcmillan@site5.com wrote:

Although that works, I’d try to implement it using vm_stat instead. Top
produces a lot of unnecessary output and it’s a bit slow.

Looks like someone was able to grab some of the info you need from
vm_stat:

http://vigodome.com/blog/2012/01/27/show-free-memory-on-osx/

On Fri, Mar 22, 2013 at 4:05 PM, Pat Collins pat@burned.com wrote:

Now you can!

I submitted this ticket a while back, with a fix provided, and I’m eager
to get it merged into Ohai:

http://tickets.opscode.com/browse/OHAI-431

Can anyone see anything glaring that would prevent it from getting
merged in?

Cheers,
Pat


Patrick Collins


Patrick Collins


Patrick Collins


#6

On Friday, April 5, 2013 at 7:00 AM, Pat Collins wrote:

Hi Opscode folks,

Is there a reason why this enhancement can’t be merged into Ohai?

https://github.com/opscode/ohai/pull/119
http://tickets.opscode.com/browse/OHAI-431

Cheers,
Pat

We just haven’t gotten to it in our regular Chef patch review meetings. I’ll make a note to look for next time (Monday at noon PDT).


Daniel DeLeo