Sponsored Content
Operating Systems HP-UX how could I get a process Memory Usage Post 302309439 by alert0919 on Tuesday 21st of April 2009 11:56:16 PM
Old 04-22-2009
how could I get a process Memory Usage

I use pstat API to get Process Infomation
I would like to get a process
1.process owner
2.how many physical memory and virtual memory and total memory used(KB) and usage(%)
3.a process excution file create time
4.a process excution file access time

I do't know which attribute it i need

thanks
_T_LONG_T pst_uid; /* Real UID */
_T_LONG_T pst_pid; /* Process ID */
_T_LONG_T pst_ppid; /* Parent process ID */
_T_LONG_T pst_dsize; /* # real pages used for data */
_T_LONG_T pst_tsize; /* # real pages used for text */
_T_LONG_T pst_ssize; /* # real pages used for stack */
_T_LONG_T pst_nice; /* Nice value */
struct __psdev pst_term;/* TTY of this process; -1/-1 if there isn't one */
_T_LONG_T pst_pgrp; /* Process group of this process */
_T_LONG_T pst_pri; /* priority of process */
_T_LONG_T pst_addr; /* address of process (in memory) */
_T_LONG_T pst_cpu; /* processor utilization for scheduling */
_T_LONG_T pst_utime; /* user time spent executing (in seconds) */
_T_LONG_T pst_stime; /* system time spent executing (in seconds) */
_T_LONG_T pst_start; /* time process started (seconds since epoch) */
_T_LONG_T pst_flag; /* flags associated with process */
_T_LONG_T pst_stat; /* Current status */
_T_LONG_T pst_wchan; /* If state PS_SLEEP, value sleeping on */
_T_LONG_T pst_procnum; /* processor this proc last run on */
char pst_cmd[PST_CLEN]; /* Command line for the process, if available */
_T_LONG_T pst_time; /* resident time for scheduling */
_T_LONG_T pst_cpticks; /* ticks of CPU time */
_T_LONG_T pst_cptickstotal; /* total ticks for life of process */
_T_LONG_T pst_fss; /* fair share scheduler group ID */
float pst_pctcpu; /* %CPU for this process during p_time */
_T_LONG_T pst_rssize; /* resident set size for process (private pages)*/
_T_LONG_T pst_suid; /* saved UID */
char pst_ucomm[PST_UCOMMLEN]; /* executable basename the process is running*/
_T_LONG_T pst_shmsize; /* # real pages used for shared memory */
_T_LONG_T pst_mmsize; /* # real pages used for memory mapped files */
_T_LONG_T pst_usize; /* # real pages used for U-Area & K-Stack */
_T_LONG_T pst_iosize; /* # real pages used for I/O device mapping */
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

how to restrict memory usage by a process

we are running red hat ES4 and i would like to know if there is anyway of restrcting the maximum amount of memory that a process can get? I have a single preocess that is taking >13GB. Thanks, Frank (4 Replies)
Discussion started by: frankkahle
4 Replies

2. Solaris

RAM Physical Memory usage by each Process.

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)
Discussion started by: bsrajirs
12 Replies

3. Shell Programming and Scripting

Memory usage of a process

hi all, i want to write a script that checks the memory usage of processes and send a mail with the name of the process witch is using more then 300mb RAM. dose anybody have a sample script or an idea how i can make it ? PROCCESSES="snmpd sendmail" for myVar in $PROCCESSES do ... (7 Replies)
Discussion started by: tafil
7 Replies

4. AIX

How to trace cpu/memory usage for a process

I don't know when the process will start and end, I need write a script to trace it's cpu/memory usage when it is runing. How to write this script? (2 Replies)
Discussion started by: rainbow_bean
2 Replies

5. Programming

Memory usage of a process having shared libraries

Hi, I have the following two processes that's built with static libraries. Both the process have many common libraries. -rwxr-xr-x 1 xxx xxx 152946280 Oct 15 08:38 server1 -rwxr-xr-x 1 xxx xxx 41633880 Oct 15 08:39 server2. I built these two server processes making all the... (1 Reply)
Discussion started by: srivatsan_vn
1 Replies

6. Emergency UNIX and Linux Support

Memory usage of a process having shared libraries

Hi, I have the following two processes that's built with static libraries. Both the process have many common libraries. -rwxr-xr-x 1 xxx xxx 152946280 Oct 15 08:38 server1 -rwxr-xr-x 1 xxx xxx 41633880 Oct 15 08:39 server2. I built these two server processes making all the... (1 Reply)
Discussion started by: srivatsan_vn
1 Replies

7. UNIX for Advanced & Expert Users

collecting memory usage by a process

Hi Guys, I work on a AIX environment and I'm trying to write a script where I can collect all the memory used by a process. Basically I'm executing the command 'ps -fu userid' to get all the process ids and then executing the 'ps v PID' to get all the memory allocated by PPID. My question is... (2 Replies)
Discussion started by: arizah
2 Replies

8. HP-UX

Virtual Memory Usage a Process

Hi all, Is there any command which shows the virtual memory usage of a particular process in HP-UX machine. I have tried with ps, top but could not get what I want. Kindly provide me a solution. Thanks in Advance ARD (4 Replies)
Discussion started by: ard
4 Replies

9. Solaris

Process memory usage

hi all gurus: I want to find out Solaris process memory usage, but got a bit confused, see if any one can provide me some guidance. i tend to use prstat -a to get total memory consumption by user (I know prstat likely have a bug that simply sum up the memory, regardless if the memory being... (5 Replies)
Discussion started by: oakville
5 Replies

10. Solaris

Find memory usage for a process

I have multiple oracle databases on one server. All the database are running from the same user i.e. oraent. The process for each database can be distinguished by the ps -ef command Eg : ps -ef | grep oraentThe Output : oraent 5361 1 0 20:58:05 ? 0:00 oracledb1... (11 Replies)
Discussion started by: yashreads
11 Replies
allmemory(1)						    BSD General Commands Manual 					      allmemory(1)

NAME
allmemory -- User-program and framework memory analysis tool. SYNOPSIS
allmemory [-f] [-sections] [-v] [-vf v_filter] [-p] [-n] [-F] [-FD] [-purge] [-noframework] [-noprocess] [-proc pid | process_name] [-noproc pid | process_name] [-32bit] [-64bit] [-i path] [-o path] [-d] allmemory diff path1 path2 [-p] [-f] [-F] [-noframework] [-noprocess] [-ff framework_filter] [-pf process_filter] [-proc pid | process_name] [-noproc pid | process_name] [-32bit] [-64bit] [-no32v64] DESCRIPTION (Normal mode) In its normal operating mode, the allmemory tool collects and analyses data on the resident memory usage of user processes. Data from each run of allmemory is saved and can be viewed and analyzed at a later time. The save location of the collected data can be specified by the user. (See the -i and -o flags below). By default allmemory presents top level summary information on all user processes and frameworks found on the system. More or less data can be displayed using the Data Reporting options specified below. IMPORTANT NOTES: This is a completely new version of the allmemory tool. To use the old version of allmemory, run /usr/local/bin/allmemory_old. If fresh data is being collected, new version of allmemory takes significantly longer to run than the old version (~30 seconds). If the state of the system has not significantly changed since the last time allmemory data was collected, make sure to use the -i or -d flags to save time when viewing data. Data Reporting options (Specify zero or more): -f Display a per-segment residency information breakdown for each framework. -sections Display a per-section residency information breakdown for each framework. -v Display information on address space layouts of each process (similar to vmmap). -vf v_filter Filter the address space output from the -v flag to only show VM Regions with more resident pages than v_filter. -p Display detailed total residency information for each process on a per VM region category basis. -F Display summary information on per-process private pages that contribute to the total resident pages for each framework. -FD Display per-segment information on per-process private pages that contribute to the total resident pages for each framework. -purge Displays the NoVolatile resident column for all processes. Purgeable volatile pages are not counted towards this total. -n Do NOT display collected data (i.e. when an automated test is running allmemory). This lowers allmemory's highwater memory usage mark. -noframework Do NOT display data collected on frameworks. -noprocess Do NOT display data collected on processes. -proc pid | process_name Display data about the process with the specified pid/name. This option can be specified more than once to display data on more than one process. -32bit Display data only for 32-bit processes. Cannot be used in conjunction with the -64bit flag. -64bit Display data only for 64-bit processes. Cannot be used in conjunction with the -32bit flag. Data Saving/Restoring options: (Specify one at most): -d Load and display the data from the default save directory ( /tmp/allmemoryDataFiles/ ) -i path Load and display the data from a previous run of allmemory stored in the <path> directory -o path Specify a directory in which to store the data collected in this run of allmemory. Defaults to: /tmp/allmemoryDataFiles/ DESCRIPTION (diff Mode) In diff mode, allmemory is used to compare data taken at two different times. This is useful when trying to track down the specifics of a memory-related regression and saves time that would be otherwise spent on tedious and error-prone arithmetic. Since allmemory has knowledge of its own data structures, this mode is robust against output format changes. Required (specify all): <path1> <path2> Paths to the two data sets to compare. Options (Specify zero or more): -proc pid | process_name Display data about the process with the specified pid/name. This option can be specified more than once to display data on more than one process. -f Display a per-segment residency information breakdown for each framework. -F Display summary information on per-process private pages that contribute to the total resident pages for each framework. -noframework Do NOT display data collected on frameworks. -noprocess Do NOT display data collected on processes. -ff framework_filter Only displays frameworks for which the difference number of resident pages is equal to or above the framework_filter value. -pf process_filter Only displays processes for which the difference number of resident pages is equal to or above the process_filter value. -p Provides a detailed breakdown of the differences between the specified data sets on a per VM-region category basis. -32bit Display data only for 32-bit processes. Cannot be used in conjunction with the -64bit flag. -64bit Display data only for 64-bit processes. Cannot be used in conjunction with the -32bit flag. -no32v64 Do not compare 32-bit processes and frameworks versus 64-bit processes and frameworks. By default, the comparison will happen. EXPLANATION OF OUTPUT
Individual Process Data Columns: PrivateRes (In pages): The number of pages resident in physical memory in a given process's address space that are not shared with other processes. This total includes private pages as well as copied pages in COW regions and resident pages in shared regions that are not used by other pro- cesses. NoSpec PrivateRes is the number of pages resident in physical memory in a process's address space not counting pages brought in specula- tively. If one were to simply count the total number of pages resident in a process's address space, that total would be the sum of Shared and Resi- dent pages. Copied (In pages): The number of copied pages resident in physical memory in a given process's address space. Copied pages are assumed to be private to the process and are counted towards the Resident total. The Copied and Dirty columns are non- exclusive, as pages can be both dirty and copied. Dirty (In pages): The number of dirty pages resident in physical memory in a given process's address space. Dirty pages are not assumed to be private to the process and so do not automatically count towards the Resident total. The Copied and Dirty columns are non-exclusive, as pages can be both dirty and copied. Swapped (In pages): Pages swapped out of a given process's address space. These pages were previously resident in physical memory and are now swapped to disk. Swapped pages do not count towards any other totals. Shared (In pages): The number of shared pages resident in physical memory in a given process's address space. This total does not count towards the Resident pages category or any other category. As was the case with NoSpec Resident pages, the NoSpec Shared pages total ignores shared pages brought in speculatively. If one were to simply count the total number of pages resident in a process's address space, that total would be the sum of Shared and Resi- dent pages. Total Process Data Columns: TotalRes (In pages): The number of pages resident in physical memory across the entire system. This total includes private pages as well as copied pages in COW regions. Shared pages are counted towards this total once (i.e. double counting is avoided). NoSpec TotalRes is the number of pages resident in physical memory across the system not counting pages brought in speculatively. Copied (In pages): The number of copied pages resident in physical memory in a given process's address space. Copied pages are assumed to be private to the process and are counted towards the Resident total. The Copied and Dirty columns are non- exclusive, as pages can be both dirty and copied. Dirty (In pages): The number of dirty pages resident in physical memory in a given process's address space. Dirty pages are not assumed to be private to the process and so do not automatically count towards the Resident total. The Copied and Dirty columns are non-exclusive, as pages can be both dirty and copied. Swapped (In pages): Pages swapped out of a given process's address space. These pages were previously resident in physical memory and are now swapped to disk. Swapped pages do not count towards any other totals. Shared (In pages): The number of shared pages resident in physical memory across the entire system. This total counts towards the TotalRes pages category and its subcategories (i.e. Copied, Dirty, Swapped). As was the case with NoSpec Resident pages, the NoSpec Shared pages total ignores shared pages brought in speculatively. Framework Data Columns: Resident (In pages): The number of pages resident in physical memory attributed to a given framework across the address spaces of all processes. A heuristic is used to avoid double counting pages shared across several processes. Any copied pages encountered are assumed to be private to the process being examined and are counted towards the Resident total. In other words, Resident is the total number of private pages attributed to a given framework, plus the number of shared resident pages (avoiding dou- ble counting). NoSpec Resident total is calculated in the same way, ignoring speculative pages. Copied (In pages): The number of copied pages resident in physical memory attributed to the given framework across the address spaces of all processes. As described above, this total is included in the total Resident and NoSpec Resident framework totals. The Copied and Dirty columns are non-exclusive, as pages can be both dirty and copied. Dirty (In pages): The number of dirty pages resident in physical memory attributed to the given framework across the address spaces of all processes. The Copied and Dirty columns are non-exclusive, as pages can be both dirty and copied. Swapped (In pages): The number of pages swapped out of physical memory attributed to the given framework. These pages were previously resident in physical mem- ory and are now swapped to disk. These pages do not count towrds any other total. Filesize (In pages): The size in pages of the framework on disk. SEE ALSO
heap(1), leaks(1), top(1), vmmap(1) Apple Inc. June 2, 2019 Apple Inc.
All times are GMT -4. The time now is 12:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy