I haven't finished the mem part but it's not too complex; you should be able to implement the remaining part of the awk script and sort and pick the output lines you want by searching the forums a bit. The mawk manual page has an example of how to implement a simple sort in awk.
My top prints "Mem: total used free buffers" followed by "Swap: total used free cached" on lines 4 and 5; I'm not entirely sure which of the "free" and "total" fields you want, but extracting the fields you want (provided you are sure which ones you want) should be similarly straightforward. I've put in placeholders for those. A complication is that the output has a human-readable suffix like "k" which I imagine might vary, so properly you should parse that before doing the math on the resulting numbers.
yeah, this thing is growing faster than my speed to read awk info :P
i will look at that and run some tests
the problem, is that all this work only o get a simple percentage of free mem, is growing in complexity and footprint
to a point where i dont know if its worth the problem
maybe i can make use of an external program to give me that info.
maybe doit myself in C? .... (actually, stole the related code of wmmem )
Hi All,
I have a pair of sun ultra 5_10 with SunOS 5.5.1.
Both are almost equally patched and set up with simillar applications.
host# uname -a
SunOS host 5.5.1 Generic_103640-24 sun4u sparc SUNW,Ultra-5_10
Even though both have
same amount of RAM ( 512 Mb ) ,
... (1 Reply)
Hi All,
Kindly help me in optimizing the server as it displays a great amount of CPU & MEM being utilised when the mysql process executes.
Below are the stats ---
--------------------------------------------------------------------------
# top
15:51:57 up 23:22, 5 users, load average:... (1 Reply)
What is amount of free RAM i have now?
total used free shared buffers cached
Mem: 1010 963 46 0 215 256
-/+ buffers/cache: 491 518
Swap: 1983 0 1983
Above is the output of... (1 Reply)
how can I find cpu usage memory usage swap usage and
I want to know CPU usage above X% and contiue Y times and memory usage above X % and contiue Y times
my final destination is monitor process
logical volume usage above X % and number of Logical voluage above
can I not to... (3 Replies)
I'm writing a bash script to log some selections from a sensors output (core temp, mb temp, etc.) and I would also like to have the current cpu usage as a percentage. I have no idea how to go about getting it in a form that a bash script can use. For example, I would simply look in the output of... (3 Replies)
Hi all,
Is it possible to get total memory usage and free memory usage without top? By Googling I found for total memory usage, use vmstat, for CPU, use mpstat, for disk I/O use iostat, is this correct? Will using sar gives the same result as ALL of these three (3) commands?
What about if I... (2 Replies)
Hi folks,
I'm a CS students enrolled in a sysadmin class where we've been covering bash scripting for the past few weeks. I have prior knowledge in java, c++, c#, python,and some scripting languages like asp.net w/c# and php. This bash stuff seems pretty neat and a bit different than what I am... (9 Replies)
I do not know shell scripting. But at work place, I have got an in and out shell scripting task. I just need to understand a very big script. Is there any tool in which I can place the script and it can tell me the meaning of the whole script? (3 Replies)
Discussion started by: lg123
3 Replies
LEARN ABOUT CENTOS
free
FREE(1) User Commands FREE(1)NAME
free - Display amount of free and used memory in the system
SYNOPSIS
free [options]
DESCRIPTION
free displays the total amount of free and used physical and swap memory in the system, as well as the buffers and caches used by the ker-
nel. The information is gathered by parsing /proc/meminfo. The displayed columns are:
total Total installed memory (MemTotal and SwapTotal in /proc/meminfo)
used Used memory (calculated as total - free)
free Unused memory (MemFree and SwapFree in /proc/meminfo)
shared Memory used (mostly) by tmpfs (Shmem in /proc/meminfo, available on kernels 2.6.32, displayed as zero if not available)
buffers
Memory used by kernel buffers (Buffers in /proc/meminfo)
cached Memory used by the page cache (calculated as Cached - Shmem in /proc/meminfo - the Cached value is actually the sum of page cache
and tmpfs memory)
OPTIONS -b, --bytes
Display the amount of memory in bytes.
-k, --kilo
Display the amount of memory in kilobytes. This is the default.
-m, --mega
Display the amount of memory in megabytes.
-g, --giga
Display the amount of memory in gigabytes.
--tera Display the amount of memory in terabytes.
-h, --human
Show all output fields automatically scaled to shortest three digit unit and display the units of print out. Following units are
used.
B = bytes
K = kilos
M = megas
G = gigas
T = teras
If unit is missing, and you have petabyte of RAM or swap, the number is in terabytes and columns might not be aligned with header.
-c, --count count
Display the result count times. Requires the -s option.
-l, --lohi
Show detailed low and high memory statistics.
-o, --old
Display the output in old format, the only difference being this option will disable the display of the "buffer adjusted" line.
-s, --seconds seconds
Continuously display the result delay seconds apart. You may actually specify any floating point number for delay, usleep(3) is
used for microsecond resolution delay times.
--si Use power of 1000 not 1024.
-t, --total
Display a line showing the column totals.
--help Print help.
-V, --version
Display version information.
FILES
/proc/meminfo
memory information
SEE ALSO ps(1), slabtop(1), top(1), vmstat(8).
AUTHORS
Written by Brian Edmonds.
REPORTING BUGS
Please send bug reports to <procps@freelists.org>
procps-ng September 2011 FREE(1)