Closed pelletierr closed 9 years ago
Hi,
Thanks for your contribution :smiley: I paste the link of your commit below, we need a Mac computer to try it on different version.
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.
Oh.. and I'm running my patch here : http://www.menzonet.org/phpSysInfo :)
Please paste output of commands: vm_stat sysctl hw.memsize
I'll test it tomorrow morning on different versions of the system.
Unfortunately, version 10.8.5 received the wrong values
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.
Paste values from Activity Monitor and corresponding vm_stat.
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.
Try now.
It doesn't make sense...
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
Anonymous pages doesn't work to list app memory. My server's runing 7.5GiO/8GiO app memory all the time.
appMemory means "Kernel + applications" (Pages wired down + Anonymous pages)
It is now what Activity Monitor shows though.
If ok close issue (also check your second issue).
sorry, said "now" but wanted to say "not"
I guess best option would be to define new mem variables to show wired and compressed. I started looking into it.
Test now (Pages occupied by compressor as buffers).
You should'nt set buffer to 0 if there's nothing, that way the line won't be drawn
Darwin display of memory usage is not good. I fixed it in my fork