Rework mem.c for FreeBSD
@lantw
Submitted by Ting-Wei Lan Assigned to Ben @bdejean
Link to original bug (#748928)
Description
The system memory usage showed in gnome-system-monitor is usually much lower than the real usage on FreeBSD. Current implmentation in libgtop is:
Used = Wired Free = Total - Wired Shared = 0 Buffer = 0 Cached = Cache User = Wired - Cache Locked = Not Supported
I think it is better to change it to:
Used = Active Free = Free Shared = 0 Buffer = Buf Cached = Cache User = Active + Wired Locked = Wired
The left-hand side means fields in the glibtop_mem struct and the right-hand
side means the value showed by top' command. It seems that the relation between various values showed in
top' command is:
Total = Active + Inact + Wired + Cache + Free
Buf is a part of Wired, so it is not listed it in the above relation.
I don't know whether there is any relation between fields in glibtop_mem struct because I cannot find documentation that describes meanings of them, so I just make the change based on their names.