LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices


Reply
  Search this Thread
Old 05-25-2022, 04:35 PM   #1
mrkey
LQ Newbie
 
Registered: May 2022
Posts: 1

Rep: Reputation: 0
Find out the total memory a certain user's processes are using


I have a Redhat 7.9 with 16GB of RAM and 8GB of Swap and because I got Swap full notifications, I would like to know how much memory does the ora user's processes are using at a certain time.

Right now, the swap is pretty ok but still being used even if the Mem is showing 1451 from 15875 being used.
Code:
free -m
              total        used        free      shared  buff/cache   available
Mem:          15875        1451        8152        5700        6272        8595
Swap:          8191        2614        5577
Now I was able to run this fancy ps command and get the memory used by the processes of every user:

Code:
ps aux | awk '{arr[$1]+=$4}; END {for (i in arr) {print i,arr[i]}}' | sort -k2
Now I have some questions about the result.

When running ps aux I see that some process are using 0.0% Mem so I assume this is a roundup for something like 0.033% so not as accurate as I would like to be. Is there a way to be more 100% accurate?

My ora user got 101.3 and that's % of RAM - so does that mean that it was using all 100% of the 16GB and some more 1.3% from the Swap?

Why do I see 1451 of RAM currently being used if the ps aux is showing that ora's processes are using more than 100% of memory.

And why is Swap being used if only a small portion of RAM is used?
 
Old 05-25-2022, 05:25 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,139

Rep: Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122Reputation: 4122
Accounting for memory usage is a black art, not a science. Anyone claiming 100% accounting is fooling themselves. Have a read of this for a tool that gives simple accurate results.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How to Find Out Top Memory Consuming Processes in Linux LXer Syndicated Linux News 0 11-05-2019 12:41 PM
LXer: What Are Zombie Processes And How To Find & Kill Zombie Processes? LXer Syndicated Linux News 0 12-10-2017 04:12 PM
Get total cpu usage, total memory usage and available memory Chiba Linux - Software 1 11-15-2014 04:36 PM
Route traffic to certain IP addresses out a certain network interface cati Linux - Networking 2 04-13-2012 08:51 AM
How can I kill all processes form a certain user ? Menestrel Linux - Newbie 6 07-05-2005 09:53 AM

LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise

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