Created attachment 162273 [details] systat -vm phys/kern mem usage Added 2 new fields at top left memory section. Before: Mem:KB REAL VIRTUAL Tot Share Tot Share Free Act 113596 17720 703456 25104 1672360 All 239340 20096 1371300 36548 After: Phy: 35% REAL VIRTUAL Kmem: 17% Mem: Tot Share Tot Share Free Act 503616 16696 1370680 27544 1307516 All 554684 18308 1967904 45132
I will take it. Thanks!
(In reply to ota from comment #0) Hi, I would suggest a different output, something like: 13 users Load 0.52 0.36 0.33 Nov 26 13:36 Mem usage: 66%Phy 26%Kmem VN PAGER SWAP PAGER Mem: Tot Share Tot Share Free in out in out Act 2668744 61628 9277296 110976 2644416 count All 2697008 70252 9366896 173320 pages Proc: Interrupts r p d s w Csw Trp Sys Int Sof Flt ioflt 687 total 231 1841 1969 4795 113 41 1262 cow atkbd0 1 1260 zfod 14 acpi0 9 0.6%Sys 0.0%Intr 3.3%User 0.0%Nice 96.1%Idle ozfod 2 ehci0 23 | | | | | | | | | | %ozfod 244 cpu0:time >> daefr hdac0 264 dtbuf 381 prcfr 76 xhci0 265 Namei Name-cache Dir-cache 208972 desvn 1773 totfr 9 em0 266 Calls hits % hits % 26987 numvn react hdac1 267 160 152 95 23689 frevn pdwak 12 ahci0 268 318 pdpgs 70 cpu1:time Disks ada0 pass0 intrn 100 cpu3:time KB/t 23.06 0.00 2418460 wire 160 cpu2:time tps 19 0 746472 act MB/s 0.42 0.00 1999176 inact %busy 0 0 cache 2644416 free buf Note the Mem usage on top. I changed your patch already, if you have no objection, I will check with other developers what they thing about it. Best.
(In reply to Marcelo Araujo from comment #2) Sorry for late reply. I didn't realize there was an update. I don't have objections about style change. However, it looks the 2nd line labels, "REAL VIRTUAL" one is gone. This label indicates left Tot/Share is for real memory and right one is for virtual memory. We need to put it back; otherwise, people won't know what they are. MEMROW begins with 2 and I suppose you've used it. I think we can start MEMROW from 1 to display %usage and keep the rest as is. As we have more space, why don't we add % virtual memory usage as well? Thanks, Hiro
(In reply to ota from comment #3) I'm aware of it, I believe I did a wrong copy/past here. Here is the patch and the right output, please, double check it: https://reviews.freebsd.org/D4281 Best,
(In reply to Marcelo Araujo from comment #4) Yes, that looks like the case. The page don't seem to allow me to put comments. So, I will post here: #1 I'd reverse these 2 lines of line 315 and 316. mvprintw(MEMROW, MEMCOL, "Mem: KB REAL VIRTUAL"); mvprintw(STATROW + 1, STATCOL + 3, "Mem usage: %%Phy %%Kmem"); MEMROW is 2 and STATROW is 0, thus 0+1. The line 316 is to draw above line 315. #2 I'm not sure which ROW is the best fit. I had thought these would belong to MEMROW and tried to stick with it. I think our options are: 1. Keep as is and treat %mem as one of STATROW. 2. Make MEMROW=1 and adjust all MEMROW + n. 3. Use MEMROW but the new row will do MEMROR - 1. #3 Given we have more space, we can also add total virtual memory,%%vir, by putfloat(100.0 * total.t_avm / total.t_vm, MEMROW, MEMCOL + 41, 3, 0, 1);
(In reply to ota from comment #5) I have addressed items #1 and #2, the #3 looks like that is the VM available and not the VM used by the system, on systat we are showing the Mem usage. As suggested by you, the VM used shows 99% in my system, what for me seems not right. I would like to commit it without adding the Virtual Memory. And perhaps, we can add it in the future. Best,
A commit references this bug: Author: araujo Date: Mon Dec 28 02:07:57 UTC 2015 New revision: 292817 URL: https://svnweb.freebsd.org/changeset/base/292817 Log: Add on systat -vm the ability to display the physical and kernel memory percent usage. PR: bin/203917 Submitted by: ota <ota@j.email.ne.jp> Approved by: bapt (mentor) Differential Revision: https://reviews.freebsd.org/D4281 Changes: head/usr.bin/systat/vmstat.c
Committed without add the Virtual memory usage, will double check it in the future, but feel free to re-send a patch that covers it. If you intend to send a patch, please Cc me. Best.
(In reply to Marcelo Araujo from comment #8) Thanks for committing. I will take a look again for vm usage although I expect it will take a while to get to it.