Hey there! I'm a new user here who registered because I couldn't get these kind of questions answered in the place I directly com from.
I've found a discrepancy in total RAM used and I can't figure out why it is. My only guess is there are some RAM used by some stuff impossible to identify, but seems pretty unlikely to me.
From the beginning:
1. Launch Activity Monitor and sum the Active Memory + Wired Memory in the Memory tab. This'll give you some number of GB used. (User RAM + system RAM that is if I'm correct).
2. Order processes by RAM and sum their RAM usage. It's not even close. And I'm talking almost 30% off.
Launch terminal and run:
(did it quickly so it's probably a little bit redundant)
It'll print out the total amount of RAM used by processes and then the active + wired RAM.
(See my example in the attached image. As you can see there's around a 25% off in this case).
Yup - file caches. All of UNIX - even OSX which loves to carve a unique path - uses memory to cache file data. For example, this is central to the way write() works.
write() does NOT guarantee the data written to a file is immediately part of the physical file on disk. Instead, the kernel parks data in free memory. Periodically this is flushed or "synced" to disk, i.e., dirty cache pages are written to disk.
read() also employs memory this way. Because disk is so much slower to find and return data, while memory is fast, when the filesystem returns data from a big file it parks big chunks of the data in memory. Subsequent reads are satisfied much faster.
You can see this in action. On a quiet system, find a ~100MB file that is human readable.
The second cat on quiet system is usually a lot faster than the first. Why? File cache. On hammered systems this may not be true. This is why hammered systems are disproportionately slower than their underused cousins. File cache availability.
real 0m0.019s
user 0m0.001s
sys 0m0.018s
~ $ du -d0 -h Desktop/file;time cat Desktop/file > /dev/null
103M Desktop/file
real 0m0.020s
user 0m0.001s
sys 0m0.018s
~ $ du -d0 -h Desktop/file;time cat Desktop/file > /dev/null
103M Desktop/file
real 0m0.020s
user 0m0.001s
sys 0m0.019s
~ $ du -d0 -h Desktop/file;time cat Desktop/file > /dev/null
103M Desktop/file
real 0m0.020s
user 0m0.001s
sys 0m0.018s
~ $
I then though that that same file might've been in RAM since the very first beginning as I had just created it, so ran find in terminal to find a 100MB file. Didn't have one so opted for a 50MB one. lol
Hello,
I have an ubuntu14.04 installed pc with 32GB ram.
Operating System: Ubuntu 14.04.5 LTS
Kernel: Linux 4.9.148-xxxx-std-ipv6-64
Architecture: x86_64
When I check free memory it shows:
total used free shared buffers cached
Mem: 31882 ... (2 Replies)
grpdsku program allows user to check their group disk space in a server environment. The data in the dialog box queries a text file. Each text file is labeled with a current timestamp. Results output to a msgbox. Also, results output to a csv file. The csv file is sent to the user via email
... (13 Replies)
Hi,
I will be creating a process myself and I want to know the average CPU and RAM used by the process over the lifetime of the process. I see that there are various tools available(pidstat) for doing , I was wondering if it possible to do it in a single command while creation.
Thanks in... (3 Replies)
I have a query someone may be able to shed some light on...
We have a Solaris 10 OS Sun V490 server Sparc.
I have a SAN attached EMC Clarrion LUN which we have app data stored on.
Pseudo name=emcpower0a
CLARiiON ID=CK200070300470
Due to storage requirements - I need to migrate this... (4 Replies)
Hi team
I have three physical servers running on Red Hat Enterprise Linux Server release 6.2 with the following memory conditions:
# cat /proc/meminfo | grep -i mem
MemTotal: 8062888 kB
MemFree: 184540 kB
Shmem: 516 kB
and the following swap conditions:
... (6 Replies)
Hi all,
We are seeing an odd problem on one of our new servers. It seems to be reporting 4MB less RAM than is installed:
# prtconf | grep Mem
Memory size: 32764 Megabytes
Our other servers for example shows none missing:
# prtconf | grep Mem
Memory size: 32768 Megabytes
Both... (5 Replies)
Hi
one of our applications that runs on our Linux server leaks memory resulting in Ram that was used by the program not being released back to the operating system once a file has been processed. the result is over a very short period virtual all the memory has been used. an example currently
... (8 Replies)
Hi i just wanted to know what is the code to display amount of RAM and also the percentage used? I know i can possibly use the vmstat code but what part indicates the RAM? Any help would be much appreciated. Thanks (1 Reply)
Hi All,
I am trying to find the physical memory usage by each process/users.
Can you please let me know how to get the memory usage?.
Thanks,
bsraj. (12 Replies)