porting an app that checks /proc/meminfo

Rainer Alves rainer.alves at gmail.com
Tue Jan 24 17:21:13 PST 2006

Fernan Aguero wrote:
> The program builds fine, but because it uses /proc/meminfo
> to check for available memory, when you run it, it will
> complain about the lack of /proc/meminfo and won't let you
> do anything. 
> How does one gets the values of i) memory used by the
> program/process and ii) amount of RAM available in the
> computer without using /proc/meminfo in FreeBSD? 

Take a loot at sysutils/muse, which uses /dev/mem to gather this info:

[rainer at bsd ~]$ muse -m
kvm_open: /dev/mem: Permission denied
kvm_open failed

[rainer at bsd ~]$ sudo muse -m
Active:      311.965 MB
Inactive:     54.039 MB
Wired:        99.977 MB
Reserved:      0.961 MB
Cache:        25.812 MB
Kernel:        0.133 MB
Interrupt:     0.008 MB
Buffer:       59.969 MB

Total:       493.637 MB
Free:          1.141 MB

More information about the freebsd-ports mailing list