Sponsored Content
Top Forums UNIX for Advanced & Expert Users Find memory usage along with time Post 302789119 by PikK45 on Wednesday 3rd of April 2013 06:31:16 AM
Old 04-03-2013
HP Find memory usage along with time

Hi Guys,

I have a script. It calls an executable inside (programmed in C). I will have to find the execution time of that script and amount of memory consumed by that process as well.

Code:
#!/bin/sh

echo "Script starting"

echo "executable staring"
executable parm1 parm2 parm3
echo "executable completed"

echo "Script completed"

exit

I know time ./script.sh will give me the execution time of this. What I would want to know is the total memory(RAM) and %CPU utilized by this as well.

System Details:
HP-UX
B.11.23
 

10 More Discussions You Might Find Interesting

1. Programming

Monitor CPU usage and Memory Usage

how can i monitor usages of CPU, Memory, Hard disk etc. under SUN Solaries through a c program or java program i want to store that data into database so i can show it graphically thanks in advance (2 Replies)
Discussion started by: Gajanad Bihani
2 Replies

2. HP-UX

how can I find cpu usage memory usage swap usage and logical volume usage

how can I find cpu usage memory usage swap usage and I want to know CPU usage above X% and contiue Y times and memory usage above X % and contiue Y times my final destination is monitor process logical volume usage above X % and number of Logical voluage above can I not to... (3 Replies)
Discussion started by: alert0919
3 Replies

3. Solaris

current CPU usage, memory usage, disk I/O oid(snmp)

Hi, I want to monitor the current cpu usage, monitor usage , disk I/o and network utlization for solaris using SNMP. I want the oids for above tasks. can you please tell me that Thank you (2 Replies)
Discussion started by: S_venkatesh
2 Replies

4. AIX

How to monitor the IBM AIX server for I/O usage,memory usage,CPU usage,network..?

How to monitor the IBM AIX server for I/O usage, memory usage, CPU usage, network usage, storage usage? (3 Replies)
Discussion started by: laknar
3 Replies

5. UNIX for Advanced & Expert Users

How to find out memory & cpu usage of a process

Hi, By using time command we can determine the execution time of a process or command. bash-2.04$ time ls -l total 0 -rw-r--r-- 1 admin tac 0 Oct 6 04:46 file1 -rw-r--r-- 1 admin tac 0 Oct 6 04:46 file2 real 0m0.002s user 0m0.000s sys 0m0.001s... (5 Replies)
Discussion started by: learn more
5 Replies

6. UNIX for Dummies Questions & Answers

Command to display the space usage (memory usage) of a specific directory.

Hi all, Can you please tell me the command, with which one can know the amount of space a specific directory has used. df -k . ---> Displays, the amount of space allocated, and used for a directory. du -k <dir name> - gives me the memory used of all the files inside <dir> But i... (2 Replies)
Discussion started by: abhisheksunkari
2 Replies

7. Shell Programming and Scripting

To find JVM memory usage in shell console

i need to find memory usage by JVM in shell prompt, i tried with pidVal=$( ps -ef | grep "/opt/bea2/jrockit/bin/java -jrockit" | grep -v grep | awk -F' ' '{print $2}' | tr "\n" "," | cut -d ',' -f1 ) top -b -n 1 | grep $pidVal this will just give cpu usage and ram... How do i find... (4 Replies)
Discussion started by: vivek d r
4 Replies

8. UNIX for Dummies Questions & Answers

Memory usage per user,percent usage,sytem time in ksh

Let's say i have 20 users logged on Server. How can I know how much memory percent used each of them is using with system time in each user? (2 Replies)
Discussion started by: roy1912
2 Replies

9. Solaris

How to find out the memory usage in Solaris?

Hi All, In one of the solaris box aslert got triggered as ... (Used_Real_Mem_Pct=93.0 Used_Swap_Space_Pct=75.0 )] when i see the usage by vmstat and sar i am not able to relate the alert with the free memory and swap memory please help to understand the vmstat output as below.. kthr ... (4 Replies)
Discussion started by: Riverstone
4 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
SC_USAGE(1)						    BSD General Commands Manual 					       SC_USAGE(1)

NAME
sc_usage -- show system call usage statistics SYNOPSIS
sc_usage [-c codefile] [-e] [-l] [-s interval] pid | cmd | -E execute DESCRIPTION
sc_usage displays an ongoing sample of system call and page fault usage statistics for a given process in a ``top-like'' fashion. It requires root privileges due to the kernel tracing facility it uses to operate. Page faults can be of the following types: PAGE_IN page had to read from disk ZERO_FILL page was created and zero filled COW page was copied from another page CACHE_HIT page was found in the cache The arguments are as follows: -c When the -c option is specified, it expects a path to a codefile that contains the mappings for the system calls. This option over- rides the default location of the system call codefile which is found in /usr/share/misc/trace.codes. -e Specifying the -e option generates output that is sorted by call count. This overrides the default sort by time. -l The -l option causes sc_usage to turn off its continuous window updating style of output and instead output as a continuous scrolling of data. -s By default, sc_usage updates its output at one second intervals. This sampling interval may be changed by specifying the -s option. Enter the interval in seconds. pid | cmd | -E execute The last argument must be a process id, a running command name, or using the -E option, an execution path followed by optional argu- ments. The system call usage data for the process or command is displayed. If the -E flag is used, sc_usage will launch the exe- cutable, pass along any optional arguments and display system call usage date for that executable. The data columns displayed are as follows: TYPE the system call type NUMBER the system call count CPU_TIME the amount of cpu time consumed WAIT_TIME the absolute time the process is waiting CURRENT_TYPE the current system call type LAST_PATHNAME_WAITED_FOR for each active thread, the last pathname that was referenced by a system call that blocked CUR_WAIT_TIME the cumulative time that a thread has been blocked THRD# the thread number PRI current scheduling priority The sc_usage command also displays some global state in the first few lines of output, including the number of preemptions, context switches, threads, faults and system calls, found during the sampling period. The current time and the elapsed time that the command has been running is also displayed here. The sc_usage command is also SIGWINCH savvy, so adjusting your window geometry may change the list of system calls being displayed. Typing a 'q' will cause sc_usage to exit immediately. Typing any other character will cause sc_usage to reset its counters and the display. SAMPLE USAGE
sc_usage Finder -e -s2 sc_usage will sort the Finder process usage data according to system call count and update the output at 2 second intervals. SEE ALSO
fs_usage(1), latency(1), top(1) Mac OS X October 28, 2002 Mac OS X
All times are GMT -4. The time now is 02:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy