LinuxQuestions.org
Help answer threads with 0 replies.
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 04-27-2012, 12:29 AM   #1
rajaniyer123
Member
 
Registered: Feb 2004
Location: BARODA, GUJARAT
Posts: 259

Rep: Reputation: 30
RHEL Memory Distribution


Hi,

I would like to know the exact memory distribution in Linux.

In the same case I have below o/ps.

ps aux --sort -rss |awk '{t+=$6}END{print t/1024/1024}'
13.8272


free -m
total used free shared buffers cached
Mem: 16050 15958 92 0 3 1581
-/+ buffers/cache: 14373 1677
Swap: 18431 2816 15615


My question is ps -aux shows 13.8272 while used shows 15.58 GB

So any idea how I can identify 15.58-13.82=1.76 GB utilized by which part of OS.

In case of solaris we have below command to check the Memory Distribution. Is there any command in linux which can show me percentage of Memory Distribution.

echo ::memstat | mdb –k

Please suggest.

Thanks
Raj
 
Old 04-27-2012, 09:49 AM   #2
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
There is also cat /proc/meminfo, which is a notion fairly unique to Linux.

The "pseudo-files" in /proc and /sys are in fact not physical files at all.

Memory allocation in a running system is always dynamic (constantly changing), and also, always lazy. The system will happily allocate "more than it needs," and "lazily, never get around to cleaning anything up," unless and until actual memory-pressure manifests itself. The system loves to have 100% of the available physical memory resource in use at one time, and it's also lazy about virtual-memory allocations as well. It doesn't care about memory that you've asked for as long as that memory is all-zeroes or untouched.

As they say in Perl circles, "laziness is a virtue." The system is carefully designed to be this way.

Last edited by sundialsvcs; 04-27-2012 at 09:54 AM.
 
Old 04-27-2012, 11:38 AM   #3
tommylovell
Member
 
Registered: Nov 2005
Distribution: Raspbian, Debian, Ubuntu
Posts: 380

Rep: Reputation: 103Reputation: 103
Also, you're totaling up the RSS of processes. This doesn't account for the kernel, loaded modules, and a lot of other areas that are non-process oriented.

Also, I'm not sure how the memory accounting is done for shared pages.

As sundialsvcs pointed out, memory accounting is always what I would call fuzzy. Trying to reconcile the different memory reports in Linux, for those that have wanted to, has always been problematic. For the rest of us, it's not a problem.
 
Old 04-27-2012, 03:34 PM   #4
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
I hadn't looked at /proc/meminfo for a long time, so the output on Fedora 17 running the 3.3.2 kernel somewhat surprised me. It's almost more than I'd want to know . . .
Code:
$ cat /proc/meminfo 
MemTotal:       12049536 kB
MemFree:         3725248 kB
Buffers:          455780 kB
Cached:          4321880 kB
SwapCached:            0 kB
Active:          4456904 kB
Inactive:        3042120 kB
Active(anon):    2725880 kB
Inactive(anon):    24456 kB
Active(file):    1731024 kB
Inactive(file):  3017664 kB
Unevictable:        3496 kB
Mlocked:            3496 kB
SwapTotal:             0 kB
SwapFree:              0 kB
Dirty:               188 kB
Writeback:             0 kB
AnonPages:       2724852 kB
Mapped:           199332 kB
Shmem:             26708 kB
Slab:             610800 kB
SReclaimable:     461204 kB
SUnreclaim:       149596 kB
KernelStack:        4464 kB
PageTables:        63224 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     6024768 kB
Committed_AS:    6048516 kB
VmallocTotal:   34359738367 kB
VmallocUsed:      330168 kB
VmallocChunk:   34359405544 kB
HardwareCorrupted:     0 kB
AnonHugePages:   1091584 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:       89792 kB
DirectMap2M:     2793472 kB
DirectMap1G:     9437184 kB
 
  


Reply



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
Help choose Distribution for USB memory stick pinuini Linux - Newbie 5 03-29-2011 02:59 PM
seeking some office distribution in rhel 5.4 for free dipesh saha Linux - Software 2 01-31-2011 02:46 AM
Always 99-100% memory in RHEL AS 3.0 sathyguy Linux - Enterprise 6 10-07-2007 06:55 AM
Suitable Distribution for my LOW MEMORY(128 MB) PC leibinitz Linux - Distributions 13 09-02-2006 08:01 AM

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

All times are GMT -5. The time now is 08:50 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