Spruce Up tools to view amount of Free Memory and Disk Usage
Spruce Up tools to view amount of Free Memory and Disk Usage
URLs:
Tools to check Free Memory available and How much SWAP memory is used
https://forums.freebsd.org/threads/free-command-perl-script-for-freebsd.299/ example of using 'free' cli
You can use this script.
# fetch http://www.cyberciti.biz/files/scripts/freebsd-memory.pl.txt
# mv freebsd-memory.pl.txt /usr/local/bin/free
# chmod +x /usr/local/bin/free
# perl --version
# whereis perl
# vi /usr/local/bin/free change first line #!/usr/bin/perl to #!/usr/local/bin/perl
# free
Linux like free command for my FreeBSD server
Freecolor is a free replacement that displays free memory graphically as a bargraph. It supports the same options as free. Install freecolor, enter:
# cd /usr/ports/sysutils/freecolor
# make install clean
OR
# pkg install freecolor
To see memory details, enter:
$ freecolor -m -o
source: http://www.cyberciti.biz/faq/freebsd-command-to-get-ram-information/
Use top command
The top display and update information about the top cpu processes including "Physical Memory Stats" as follows (from top(1) man page):
- Active: number of bytes active.
- Inact: number of bytes inactive.
- Wired: number of bytes wired down, including BIO-level cached file data pages.
- Cache: number of clean bytes caching data that are available for immediate reallocation.
- Buf: number of bytes used for BIO-level disk caching.
- Free: number of bytes free.
$ top
Installing htop on FreeBSD
First, make sure you system is up to date (see how to install sudo on FreeBSD or use the su - command to gain root access):$ sudo pkg update
$ sudo pkg upgrade
Finally, run the following to install htop on FreeBSD:$ sudo pkg install htop
You can avoid Perl based code and use standard sh shell to get same info using freebsd-memory.sh script:$ fetch https://raw.githubusercontent.com/ocochard/myscripts/master/FreeBSD/freebsd-memory.sh
## or use curl command ##
## $ curl -O https://raw.githubusercontent.com/ocochard/myscripts/master/FreeBSD/freebsd-memory.sh
$ sh freebsd-memory.sh
Outputs from my FreeBSD based home router:
SYSTEM MEMORY INFORMATION: mem_wire: 70152192 ( 66MB) [ 14%] Wired: disabled for paging out mem_active: + 44515328 ( 42MB) [ 9%] Active: recently referenced mem_inactive:+ 333316096 ( 317MB) [ 67%] Inactive: recently not referenced mem_cache: + 798720 ( 0MB) [ 0%] Cached: almost avail. for allocation mem_free: + 44724224 ( 42MB) [ 9%] Free: fully available for allocation mem_gap_vm: + -45056 ( 0MB) [ 0%] Memory gap: UNKNOWN ______________ ____________ ___________ ______ mem_all: = 493461504 ( 470MB) [100%] Total real memory managed mem_gap_sys: + 9297920 ( 8MB) Memory gap: Kernel?! ______________ ____________ ___________ mem_phys: = 502759424 ( 479MB) Total real memory available mem_gap_hw: + 34111488 ( 32MB) Memory gap: Segment Mappings?! ______________ ____________ ___________ mem_hw: = 536870912 ( 512MB) Total real memory installed SYSTEM MEMORY SUMMARY: mem_used: 158031872 ( 150MB) [ 29%] Logically used memory mem_avail: + 378839040 ( 361MB) [ 70%] Logically available memory ______________ ____________ __________ _______ mem_total: = 536870912 ( 512MB) [100%] Logically total memory
BSD
- FreeBSD: pkg install duf
Comments
Post a Comment