systat -vm output showing negative total virtual memory

Ulrich Spoerlein uspoerlein at gmail.com
Thu Nov 16 11:45:34 PST 2006


Ruslan Ermilov wrote:
> sysctl(8) knows that t_vm is in bytes, but for the other stats
> it thinks they are in pages.  "systat -vm" thinks they are all
> in bytes.  Here's a fix:

Thanks!, I applied your patch to RELENG_6


# sysctl vm.vmtotal ; ./sysctl vm.vmtotal
vm.vmtotal: 
System wide totals computed every five seconds: (values in kilobytes)
===============================================
Processes:              (RUNQ: 1 Disk Wait: 0 Page Wait: 0 Sleep: 45)
Virtual Memory:         (Total: 797461K, Active 92512K)
Real Memory:            (Total: 3327992K Active 48124K)
Shared Virtual Memory:  (Total: 11856K Active: 7772K)
Shared Real Memory:     (Total: 7644K Active: 5364K)
Free Memory Pages:      145964K

vm.vmtotal: 
System wide totals computed every five seconds: (values in kilobytes)
===============================================
Processes:              (RUNQ: 1 Disk Wait: 0 Page Wait: 0 Sleep: 45)
Virtual Memory:         (Total: 797461K, Active 22K)
Real Memory:            (Total: 3327992K Active 48128K)
Shared Virtual Memory:  (Total: 2K Active: 1K)
Shared Real Memory:     (Total: 7644K Active: 5364K)
Free Memory Pages:      145964K


22K active VM and 1K shared? Seems pretty low to me...

Here's the systat -vm output

Mem:KB    REAL            VIRTUAL                  
        Tot   Share      Tot    Share    Free      
Act   48384    5424    92800     7844  145692 count
All 3328264    7704-1028565k    11928         pages


Mem:KB    REAL            VIRTUAL                  
        Tot   Share      Tot    Share    Free      
Act   48464    5372       22        1  145692 count
All 3328264    7652   797461        2         pages


The total value seems more sane, but I doubt the active total value.
top(1) says

106 processes: 3 running, 80 sleeping, 1 zombie, 22 waiting
CPU states:  8.9% user,  0.0% nice, 11.4% system,  0.8% interrupt, 78.9% idle
Mem: 48M Active, 2834M Inact, 239M Wired, 133M Cache, 112M Buf, 4680K Free
Swap: 1024M Total, 36K Used, 1024M Free

Yes, the system is totally idle, that may explain the values above. If
your fix is correct (sorry, but I'm not in a position to judge your
work), would it be possible to have a quick MFC to RELENG_6 and
RELENG_6_2?


Ulrich Spoerlein
-- 
A: Yes.
>Q: Are you sure?
> >A: Because it reverses the logical flow of conversation.
> >>Q: Why is top posting frowned upon?


More information about the freebsd-stable mailing list