LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-15-2012, 04:30 PM   #1
xenner
Member
 
Registered: Jul 2009
Location: Brisbane
Distribution: RHEL 6.5
Posts: 39

Rep: Reputation: 0
Question Correlation between "free -m" shared line & "/proc/meminfo" shmem RHEL 6.2 - Anyone?


Hi,

I would like to know, if anyone has any ideas, the correlation to the 'shared' memory column in "free -m" and the shmem when you do a "cat /proc/meminfo".
I was recently asked by a dba, which I support, why the shared memory in "free" was completely different to the "shmem" in /proc/meminfo".
Embarrassed, I returned to my desk and avoided the question, stating "I will get back to you".

Can someone please shed some light on this for me, as I have had no luck in searching for this answer.
REDHAT 6.2 (But I'm sure it's not limited to this flavour alone).
 
Old 11-15-2012, 04:58 PM   #2
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,979
Blog Entries: 1

Rep: Reputation: 209Reputation: 209Reputation: 209
From the man page...

Code:
FREE(1)                       Linux User’s Manual                      FREE(1)

NAME
       free - Display amount of free and used memory in the system

SYNOPSIS
       free [-b | -k | -m] [-o] [-s delay ] [-t] [-l] [-V]

DESCRIPTION
       free displays the total amount of free and used physical and swap memory in the system, as well as the buffers used by the kernel.  The shared memory column should be ignored; it is obsolete.

   Options
       The -b switch displays the amount of memory in bytes; the -k switch (set by default) displays it  in  kilobytes;  the  -m  switch  displays  it  in
       megabytes.

       The -t switch displays a line containing the totals.

       The -o switch disables the display of a "buffer adjusted" line.  If the -o option is not specified, free subtracts buffer memory from the used mem-
       ory and adds it to the free memory reported.

       The -s switch activates continuous polling delay seconds apart. You may actually specify any floating point number for delay, usleep(3) is used for
       microsecond resolution delay times.

       The -l switch shows detailed low and high memory statistics.

       The -V switch displays version information.

FILES
       /proc/meminfo-- memory information

SEE ALSO
       ps(1), slabtop(1), vmstat(8), top(1)

AUTHORS
       Written by Brian Edmonds.
It's probably not being displayed because it isn't reporting right.

--C
 
1 members found this post helpful.
Old 11-15-2012, 05:11 PM   #3
xenner
Member
 
Registered: Jul 2009
Location: Brisbane
Distribution: RHEL 6.5
Posts: 39

Original Poster
Rep: Reputation: 0
WOW!!!... I can't believe I missed that - considering I even read the man page... I'm so sorry about that.. I generally laugh at ppl that don't read it.

Okay, so the shared memory in the "free" command is obsolete, that's good news.
As a segue to this post then, am I correct in assuming that the /proc/meminfo - shmem is actually in fact shared memory? If so, what is it shared between? The OS and the applications? Is it displaying the reserved memory for the OS? Is it possible to change this to anything other than what it's set at? As I have two servers, supposedly configured the same. One has shmem as 288Kb and the other at 18769372Kb.

Thanks for your assistance.

*shaking head*... I still can't believe I skipped that in the man page. So sorry to everyone in the future that's reading this post... omg.
 
Old 11-15-2012, 05:36 PM   #4
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,979
Blog Entries: 1

Rep: Reputation: 209Reputation: 209Reputation: 209
No worries...I've done the some countless times :-)

So shmem is what's in shared memory. The best way to find out is run the ipcs command

Code:
root@host# ipcs -m
Then run a (the <shmid> is what you found with the ipcs -m command)...

Code:
ipcs -m -i <shmid>
This shows more information about a specified segment including the PID of the process creating (cpid) and the last (lpid) using it.

This will output the shared memory usage, you can see the allocated segments with the corresponding sizes.

You can also look to see what's in shared memory

Code:
root@host# ls -l /dev/shm
You can adjust how much shmem is alloted with the sysctl command...to view current configs...

Code:
root@host# sysctl kernel.shm{max,all,mni}
 
1 members found this post helpful.
  


Reply

Tags
free, memory, proc, redhat, shared memory



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
"Shared physical device" versus "Virtual network" ThomasRonshof Linux - Virtualization and Cloud 2 06-17-2011 03:27 PM
[SOLVED] "Insert" & "Delete" key returns "~" in a terminal. sharky Linux - General 15 04-26-2011 08:36 AM
RHEL 5.4 (Tikanga) on "HP Proliant 380 G6" down, "kernel: Uhhuh. NMI received. ...." pkhera_2001 Linux - Hardware 12 09-01-2010 03:37 AM
LXer: Displaying "MyComputer", "Trash", "Network Servers" Icons On A GNOME Desktop LXer Syndicated Linux News 0 04-02-2007 08:31 AM
Can you explain the difference between "Free Software (GNU)" and "Open Source"? vharishankar General 5 03-03-2005 09:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration