Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Find memory used by a process
Hi Ron,
Thanks for your mail.
At present I am unfortunate becoz, we are using solaris and in next year i will fortunate, becoz we are migrating the systems to linux.
Anyway thanks for the reply.
raJ
"Reidy, Ron" <Ron.Reidy_at_arraybiopharma.com> wrote: Raj,
This took a little digging, but here are the answers:
The /proc filesystem will provide you with the data you want. To see the size of memory consumption, issue this command:
cat /proc/PID/status | egrep '(^Vm)' | cut --field=2 --delimiter=':'
The above will yield the sizes of all the segments of memory the process is using at the time the command is issued. Add them up, and that is your total memory consumption for the process. This information can be parsed using the Perl module Linux::stat. For those who do not know or care to use Perl (GAAA!), there is a Tcl script here (http://ldas-cit.ligo.caltech.edu/doc/tcl_docs/html/procfstcl.html - procfs.tcl) which may do the same thing.
If you are leery about using Perl, Tcl, or looking directly at the /proc filesystem, consult the ps(1) man page on your system.
2. For sorting using the 'ps' command, you will need to consult the sort(1) man page on your system.
3. PGA memory is seen in v$session. For SGA usage, I'm also not sure about this at this time.
I also highly recommend the book Optimizing Linux Performance. This book is very good with lots of tool and usage suggestions for monitoring and diagnosing Linux performance.
Happy investigating.
Hi All,
when I issue
ps -efl |grep 7309
8 S oracle 7309 1 0 46 22 ? 504289 ? Jul 27 ? 0:01 oracledev (LOCAL=NO)
it is giving the memory used by this process is 504K. Where as when I did the top or pmap for this process
it is showing around 4GB (which includes shared mem and private mem)
Can someone throw somelight on this, what is the exact memory used by the above process ?
(also how to get the sort by SIZE column in ps -efl
(and how to get the details from oracle database howmuch mem being used by a session).
Thanks in advance
Raj
-- http://www.freelists.org/webpage/oracle-lReceived on Tue Aug 02 2005 - 18:04:35 CDT
![]() |
![]() |