FreeBSD View Memory Usage
Get memory from dmesg:
[root@freebitch10 /]# dmesg | grep memory real memory = 134152192 (127 MB) avail memory = 102039552 (97 MB)
To see swap memory only
[root@freebitch10 /]# swapinfo Device 1K-blocks Used Avail Capacity /dev/ada0p3 314368 13052 301316 4%
Total physical memory in the system (with sysctl):
[root@freebitch10 /]# sysctl hw.physmem hw.physmem: 110563328
To see memory stats in real time (systat -v)
root@freebitch1:~ # systat -v
2 users Load 0.35 0.22 0.17 Aug 14 22:59
Mem usage: 87%Phy 17%Kmem VN PAGER SWAP PAGER
Mem: REAL VIRTUAL in out in out
Tot Share Tot Share Free count
Act 40620K 13136K 414380K 47316K 61972K pages
All 43836K 16352K 458624K 91560K ioflt Interrupts
Proc: cow 24 total
r p d s w Csw Trp Sys Int Sof Flt zfod atkbd0 1
32 101 48 2 11 8 ozfod ata0 14
%ozfod ata1 15
0.0%Sys 0.0%Intr 0.0%User 0.0%Nice 100%Idle daefr 2 em0:irq0
| | | | | | | | | | | prcfr 12 cpu0:timer
totfr 10 cpu1:timer
7 dtbuf react
Namei Name-cache Dir-cache 29746 desvn pdwak
Calls hits % hits % 26848 numvn 3 pdpgs
15 15 100 9222 frevn intrn
142M wire
Disks ada0 cd0 pass0 pass1 11136K act
KB/t 0.00 0.00 0.00 0.00 240M inact
tps 0 0 0 0 14372K laund
MB/s 0.00 0.00 0.00 0.00 61972K free
%busy 0 0 0 0 55600K buf
Another way is to use top command
[root@freebitch10 /]# top -n | grep Mem Mem: 3704K Active, 35M Inact, 41M Wired, 940K Cache, 20M Buf, 20M Free
Just to see free memory
[root@freebitch10 /]# top -d 1|grep '^Mem:'|cut -d ',' -f 6 20M Free
You can also install sysinfo (utility used to gather system configuration information)
[root@freebitch10 /]# pkg install sysinfo Updating FreeBSD repository catalogue... FreeBSD repository is up-to-date. All repositories are up-to-date. The following 1 packages will be affected (of 0 checked): New packages to be INSTALLED: sysinfo: 1.0.1_2 The process will require 39 KB more space. 16 KB to be downloaded. Proceed with this action? [y/N]: y Fetching sysinfo-1.0.1_2.txz: 100% 16 KB 16.7k/s 00:01 Checking integrity... done (0 conflicting) [1/1] Installing sysinfo-1.0.1_2: 100%
And get the memory information:
[root@freebitch10 /]# sysinfo mem Generated by SysInfo v1.0.1 by Daniel Gerzo RAM information Memory information from dmidecode(8) WARNING: You will need to install the sysutils/dmidecode port in order to obtain this information. System memory summary Total real memory available: 105 MB Logically used memory: 51 MB Logically available memory: 53 MB Swap information Device 1K-blocks Used Avail Capacity /dev/ada0p3 314368 13M 294M 4%
Or install freecolor ( like Linux free command )
[root@freebitch10 /]# pkg install freecolor Updating FreeBSD repository catalogue... FreeBSD repository is up-to-date. All repositories are up-to-date. The following 2 packages will be affected (of 0 checked): New packages to be INSTALLED: freecolor: 0.9.2_1 libstatgrab: 0.91 The process will require 549 KB more space. 118 KB to be downloaded. Proceed with this action? [y/N]: y Fetching freecolor-0.9.2_1.txz: 100% 5 KB 5.3k/s 00:01 Fetching libstatgrab-0.91.txz: 100% 113 KB 115.7k/s 00:01 Checking integrity... done (0 conflicting) [1/2] Installing libstatgrab-0.91: 100% [2/2] Installing freecolor-0.9.2_1: 100%
To view memory information in text mode
[root@freebitch10 /]# freecolor -t -m -o
total used free shared buffers cached
Mem: 101 45 56 0 0 0
Swap: 307 12 294
Total: 408 = ( 57 (used) + 351 (free))
To view memory information in graphical mode
[root@freebitch10 /]# freecolor -t -m Physical : [###################................] 56% (57/101) Swap : [#################################..] 95% (294/307) Total : [##############################%%%%%] (408=351+56)
Categories: bsd
freebsd free command, freebsd memory usage, view memory
Comments (0)
Trackbacks (0)
Leave a comment
Trackback