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

Darwin memory usage not good #59

Closed
pelletierr opened this issue Aug 5, 2014 · 19 comments
Closed

Darwin memory usage not good #59

pelletierr opened this issue Aug 5, 2014 · 19 comments
Labels

Comments

@pelletierr
Copy link

Darwin display of memory usage is not good. I fixed it in my fork

@rk4an
Copy link
Contributor

rk4an commented Aug 5, 2014

Hi,

Thanks for your contribution 😃 I paste the link of your commit below, we need a Mac computer to try it on different version.

https://github.com/pelletierr/phpsysinfo/commit/5b396a8b2885307b71a5331b3f0dab9801c0f29e#diff-d41d8cd98f00b204e9800998ecf8427e

@rk4an rk4an added the bug label Aug 5, 2014
@pelletierr
Copy link
Author

If I had a beefier setup @ home, I'd virtualize 10.5 to 10.9 so you could try it. It was trial and error to get the good numbers. What Activity monitor was showing before 10.9 was different also.

@pelletierr
Copy link
Author

Oh.. and I'm running my patch here : http://www.menzonet.org/phpSysInfo :)

@namiltd
Copy link
Member

namiltd commented Aug 5, 2014

Please paste output of commands:
vm_stat
sysctl hw.memsize

I'll test it tomorrow morning on different versions of the system.

@namiltd
Copy link
Member

namiltd commented Aug 6, 2014

Unfortunately, version 10.8.5 received the wrong values

@pelletierr
Copy link
Author

vm_stat : Mach Virtual Memory Statistics: (page size of 4096 bytes)
Pages free: 753222.
Pages active: 1870856.
Pages inactive: 535981.
Pages speculative: 531793.
Pages throttled: 0.
Pages wired down: 443492.
Pages purgeable: 277.
"Translation faults": 2912088170.
Pages copy-on-write: 239224603.
Pages zero filled: 962449612.
Pages reactivated: 378063.
Pages purged: 635699.
File-backed pages: 844582.
Anonymous pages: 2094048.
Pages stored in compressor: 79413.
Pages occupied by compressor: 56969.
Decompressions: 2126.
Compressions: 82387.
Pageins: 1961548.
Pageouts: 23343.
Swapins: 264.
Swapouts: 264.

hw.memsize: 17179869184

Note that Activity Monitor doesn't show the same values in 10.8 and 10.9. I changed phpSysInfo to show the 10.9 values, which IMHO makes more sense than what was shown prior to Mavericks, since OS X was doing a lot of file cache but was showing that memory as free.

@namiltd
Copy link
Member

namiltd commented Aug 6, 2014

Paste values ​​from Activity Monitor and corresponding vm_stat.

@pelletierr
Copy link
Author

capture decran 2014-08-06 a 10 57 14

Mach Virtual Memory Statistics: (page size of 4096 bytes)
Pages free: 10618.
Pages active: 1894043.
Pages inactive: 988141.
Pages speculative: 806200.
Pages throttled: 0.
Pages wired down: 437176.
Pages purgeable: 10356.
"Translation faults": 2938853787.
Pages copy-on-write: 241916814.
Pages zero filled: 971743078.
Pages reactivated: 379509.
Pages purged: 637333.
File-backed pages: 1552166.
Anonymous pages: 2136218.
Pages stored in compressor: 77894.
Pages occupied by compressor: 56429.
Decompressions: 3639.
Compressions: 82391.
Pageins: 1973731.
Pageouts: 23343.
Swapins: 264.
Swapouts: 264.

@namiltd
Copy link
Member

namiltd commented Aug 6, 2014

Try now.

@pelletierr
Copy link
Author

It doesn't make sense...
image

@namiltd
Copy link
Member

namiltd commented Aug 6, 2014

Mio <-> Gio

10.01+5,75 = 15.75
15.99-15.75=0,24 = only 240 Mio unknown memory

Look at: http://www.badrit.com/blog/2014/5/1/how-to-calc-memory-usage-in-mavericks-programmatically

@pelletierr
Copy link
Author

Anonymous pages doesn't work to list app memory. My server's runing 7.5GiO/8GiO app memory all the time.

@namiltd
Copy link
Member

namiltd commented Aug 6, 2014

appMemory means "Kernel + applications" (Pages wired down + Anonymous pages)

@pelletierr
Copy link
Author

It is now what Activity Monitor shows though.

@namiltd
Copy link
Member

namiltd commented Aug 6, 2014

If ok close issue (also check your second issue).

@pelletierr
Copy link
Author

sorry, said "now" but wanted to say "not"

@pelletierr
Copy link
Author

I guess best option would be to define new mem variables to show wired and compressed. I started looking into it.

@namiltd
Copy link
Member

namiltd commented Aug 6, 2014

Test now (Pages occupied by compressor as buffers).

@pelletierr
Copy link
Author

You should'nt set buffer to 0 if there's nothing, that way the line won't be drawn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants