+ Reply to Thread
Results 1 to 1 of 1

Thread: How to find RAM size / Memory size in FreeBSD?

  1. #1

    Thumbs up How to find RAM size / Memory size in FreeBSD?

    To displays the total amount of free and used physical and swap memory in the system, as well as the buffers used by the kernel you need to install special script Most user use sysctl command to get all data.There is a perl script that automates everything and display back result on screen.

    This script query the system through the generic sysctl interface. The sysctl utility retrieves kernel state and allows processes with appropriate privilege to set kernel state. You must have perl installed on FreeBSD.


    Download perl script ::

    Code:
    #fetch http://www.servergenie.com/freebsd-memory.pl.txt
    #mv freebsd-memory.pl.txt /usr/local/bin/free
    #chmod +x /usr/local/bin/free
    Make sure perl is installed. Now to display or list total system memory usage type::

    #free

    Output::

    Code:
    SYSTEM MEMORY INFORMATION:
    mem_wire:          25341952 (     24MB) [  9%] Wired: disabled for paging out
    mem_active:  +     47529984 (     45MB) [ 18%] Active: recently referenced
    mem_inactive:+     15605760 (     14MB) [  6%] Inactive: recently not referenced
    mem_cache:   +        16384 (      0MB) [  0%] Cached: almost avail. for allocation
    mem_free:    +    165556224 (    157MB) [ 65%] Free: fully available for allocation
    mem_gap_vm:  +       389120 (      0MB) [  0%] Memory gap: UNKNOWN
    -------------- ------------ ----------- ------
    mem_all:     =    254439424 (    242MB) [100%] Total real memory managed
    mem_gap_sys: +      4988928 (      4MB)        Memory gap: Kernel?!
    -------------- ------------ -----------
    mem_phys:    =    259428352 (    247MB)        Total real memory available
    mem_gap_hw:  +      9007104 (      8MB)        Memory gap: Segment Mappings?!
    -------------- ------------ -----------
    mem_hw:      =    268435456 (    256MB)        Total real memory installed
    
    SYSTEM MEMORY SUMMARY:
    mem_used:          87257088 (     83MB) [ 32%] Logically used memory
    mem_avail:   +    181178368 (    172MB) [ 67%] Logically available memory
    -------------- ------------ ----------- ------
    mem_total:   =    268435456 (    256MB) [100%] Logically total memory

    Linux like free command for FreeBSD

    Freecolor is a free replacement that displays free memory graphically as a bargraph. It supports the same options as free. Install freecolor, enter:

    Code:
    #cd /usr/ports/sysutils/freecolor
    #make install clean
    To see memory details, enter:

    #freecolor -m -o

    Sample output:
    Code:
                  total       used       free     shared    buffers     cached
    Mem:          4082        825       3256          0          0        117
    Swap:         2048          0       2047
    #freecolor -t -m -o

    Sample output:

    Code:
           
                 total       used       free     shared    buffers     cached
    Mem:          4082        825       3256          0          0        117
    Swap:         2048          0       2047
    Total:        6130 = (     826 (used) +     5421 (free))
    Last edited by James007; 09-30-2009 at 01:10 PM.
    ====================
    ZipServers Tech Support
    Managed Services & Hosting
    http://www.zipservers.com

    ====================

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts