Sponsored Content
Top Forums Shell Programming and Scripting Script to record max memory usage of program Post 303021391 by LMHmedchem on Thursday 9th of August 2018 01:19:50 PM
Old 08-09-2018
Script to record max memory usage of program

Hello,

I am working on an application that uses allot of memory depending on the input. I am also working on more than one processing algorithm.

The program has a long processing time (hours) so it would be nice to be able to monitor the maximum memory footprint of the application during runs of various data.

It seems like there may be a linux tool that could do that from a script but I don't know of such a thing.

I am running under windows with cygwin so I have most of the linux toolbox, but could do this in open suse as well.

Are there any suggestions?

------ Post updated 08-09-18 at 01:19 PM ------

It looks like

/usr/bin/time -v

gives me the output I need.
Code:
User time (seconds): 354.48
System time (seconds): 0.00
Percent of CPU this job got: 99%
Elapsed (wall clock) time (h:mm:ss or m:ss): 5:54.98
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 350976
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 1366
Minor (reclaiming a frame) page faults: 0
Voluntary context switches: 0
Involuntary context switches: 0
Swaps: 0
File system inputs: 0
File system outputs: 0
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 65536
Exit status: 0

Now I need to figure out where all those page faults are coming from. I would appreciate other suggestions if they are out there.

Thanks,

LMHmedchem
 

10 More Discussions You Might Find Interesting

1. AIX

ulimits max locked memory virtual memory

Hi, Would any one be so kind to explain me : are ulimits defined for each user seperately ? When ? Specialy what is the impact of : max locked memory and virtual memory on performance of applications for a user. Many thanks. PS : this is what I can see in MAN : ulimit ] ... (5 Replies)
Discussion started by: big123456
5 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. Solaris

restrcit physical memory with zone.max-locked-memory

Is it possible to restrict physical memory in solaris zone with zone.max-locked-memory just like we can do with rcapd ? I do not want to used rcapd (1 Reply)
Discussion started by: fugitive
1 Replies

6. Shell Programming and Scripting

help in high memory usage alert script

can any one please help me to shell script high memory usage alert (6 Replies)
Discussion started by: robo
6 Replies

7. Shell Programming and Scripting

Help creating a timestamp script to record mem usage

Hi, I'm looking into doing a few performance tweaks by adjusting my max memory on a few lpars. I would to create a time stamp script so i could review it for a week and determine how much space i can lower my max memory to so i could reclaim and allocate that memory to where it is needed the... (2 Replies)
Discussion started by: vpundit
2 Replies

8. AIX

Script to check the memory usage in AIX

Hello Everyone, I'm looking for a efficient script that monitors the memory usage on AIX and send email alerts when it reaches certain point. Q) need to get alerts, when the memory usage exceed 90% on AIX? or Q) Need to get alerts when available free Memory is 1G or 10% etc Any idea... (3 Replies)
Discussion started by: System Admin 77
3 Replies

9. Shell Programming and Scripting

Shell script to calculate the max cpu usage from the main script

Hi All, I have a script which does report the cpu usuage, there are few output parameter/fields displayed from the script. My problem is I have monitor the output and decide which cpu number (column 2) has maximum value (column 6). Since the output is displayed/updated every seconds, it's very... (1 Reply)
Discussion started by: Optimus81
1 Replies

10. 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
TIME(1) 						    BSD General Commands Manual 						   TIME(1)

NAME
time -- time command execution SYNOPSIS
time [-clp] command [argument ...] DESCRIPTION
The time utility executes and times command. After the command finishes, time writes the total elapsed time (wall clock time), (``real''), the CPU time spent executing command at user level (``user''), and the CPU time spent executing in the operating system kernel (``sys''), to the standard error stream. Times are reported in seconds. Available options: -c Displays information in the format used by the time builtin of csh(1). -l Lists resource utilization information. The contents of the command process's rusage structure are printed; see below. -p The output is formatted as specified by IEEE Std 1003.2-1992 (``POSIX.2''). Some shells, such as csh(1) and ksh(1), have their own and syntactically different built-in version of time. The utility described here is available as /usr/bin/time to users of these shells. Resource Utilization If the -l option is given, the following resource usage information is displayed in addition to the timing information: maximum resident set size average shared memory size average unshared data size average unshared stack size page reclaims page faults swaps block input operations block output operations messages sent messages received signals received voluntary context switches involuntary context switches Resource usage is the total for the execution of command and any child processes it spawns, as per wait4(2). FILES
<sys/resource.h> EXIT STATUS
The time utility exits with one of the following values: 1-125 An error occurred in the time utility. 126 The command was found but could not be invoked. 127 The command could not be found. Otherwise, the exit status of time will be that of command. SEE ALSO
csh(1), ksh(1), clock_gettime(2), getrusage(2) STANDARDS
The time utility conforms to IEEE Std 1003.2-1992 (``POSIX.2''). BUGS
The granularity of seconds on microprocessors is crude and can result in times being reported for CPU usage which are too large by a second. BSD
November 9, 2011 BSD
All times are GMT -4. The time now is 04:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy