Sponsored Content
Full Discussion: Query on awk
Top Forums UNIX for Beginners Questions & Answers Query on awk Post 303015225 by bakunin on Saturday 31st of March 2018 12:23:24 AM
Old 03-31-2018
Quote:
Originally Posted by nextStep
I am trying to find the RAM usage for one of the process from a group of servers.
This is less trivial than it seems to be. A process can have several types of memory allocated:

1) real memory
This is real RAM the process uses.

2) virtual memory
This is real memory as above plus allocated but swapped out memory. This actually is what the vsz metric in the ps output shows.

3) shared memory segments
Sometimes several processes use some memory segment collectively. I.e. database software Oracle, DB/2) makes extensive use of this feature. Use the ipcs command to find out if the process owns shared memory segments.

I hope this helps.

bakunin
This User Gave Thanks to bakunin For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Query In awk

Is it possible to have a pattern as RS in awk. For Example pl. go through the statement; " Account Serial Number: 88888888 TT00X000000XXXXXXXXXXXXX SS00X000000XX.000,XXXXXXXXXXXXXXXXXX0000XXXXXXX0000000000 WW00X0000000XX000000000000MMMMMMM MMMMMMM0000AA11110000000000000000000000000... (1 Reply)
Discussion started by: raguramtgr
1 Replies

2. UNIX for Dummies Questions & Answers

Query in awk

file "batsmen" contains Bradman;Australia;52;6996 Gavaskar;India;124;10122 Sobers;West;Indies;93;8032 Border;Australia;109;8075 Miandad;Pakistan;97;7121 Gower;England;94;7023 Boycott;England;108;8114 My awk script contains awk '{FS=";"} {len=length($1)}; ... (1 Reply)
Discussion started by: raguramtgr
1 Replies

3. UNIX for Dummies Questions & Answers

some query in awk

Hi , I want to assign a value to variable which will have size of the file that is we have following files for eg: ls -ltr -rw-rw-r-- 1 dsadmin dstage 34 Oct 29 12:14 some.txt -rw-rw-r-- 1 dsadmin dstage 0 Oct 29 14:52 eg.txt -rwxrwxr-x 1 dsadmin dstage 1453 Oct... (2 Replies)
Discussion started by: Amey Joshi
2 Replies

4. Shell Programming and Scripting

Awk Gsub Query

Hi, Can some one please explain the following line please throw some light on the ones marked in red awk '{print $9}' ${FTP_LOG} | awk -v start=${START_DATE} 'BEGIN { FS = "." } { old_line1=$0; gsub(/\-/,""); if ( $3 >= start ) print old_line1 }' | awk -v end=${END_DATE} 'BEGIN { FS="." } {... (3 Replies)
Discussion started by: crosairs
3 Replies

5. Solaris

awk output query

Hi Everyone, When i issue command like ls -l | awk '/udtts/ {print $9}' =============================== I am getting output as udttsGEHLNAR.6864 udttsGEHLNAR.7921 udttsNARALAX.15415 udttsNARALAX.18016 But I want output after dot i.e like 6864 7921 15415 18016 (3 Replies)
Discussion started by: gehlnar
3 Replies

6. Shell Programming and Scripting

sed or awk query

I have a set of multiple files out of which one i am showing below : A0120110124102329 BED. B01***DETALLADA 43984 The BO1 is the starting pattern of the second line. In the 2nd line in position 30,31,32 i need to replace 111, instead of 3... (2 Replies)
Discussion started by: dazdseg
2 Replies

7. Shell Programming and Scripting

AWK Query

i have a log file where in i have 3 columns a 11 test1 b 22 test2 in a script, i want to pass first column as an argument to awk so that i can get the second and third column respectively Example : If i pass ($1 i.e 'a' to an awk, the result should be 11 test1) i tried different awk... (2 Replies)
Discussion started by: vkca
2 Replies

8. Shell Programming and Scripting

awk query

Dear all, I find a shell script about awk command in the forum regarding "Find and replace duplicate column values in a row" In this thread, there is a command line as shown below to replace duplicate awk -F, '{for (i=1;i<=NF;i++){if (v++){b=$i;$i=""}};print $0} END { print "dups are"... (1 Reply)
Discussion started by: eldonlck
1 Replies

9. UNIX for Dummies Questions & Answers

Awk - query about arrays

Hello again, I have example config file with two arrays: tab1="name1 surname1" tab1="name2 surname2" tab1="name3 surname3" tab2="First" tab2="Second"and csv file: "aaaaa","surname1","name1","ddddd,eeeee","ffffff","ggggg","3","2012/02/22 12:25:21","2012/02/22... (7 Replies)
Discussion started by: haczyk
7 Replies

10. Shell Programming and Scripting

awk query

Hi, I have a sample file in the following format. 000013560240|000013560240|001|P|155|99396|0||SS00325665| 000013560240|000013560240|002|P|17|99000|0||SS00325665| 000013560240|000013560240|002|F|-17|99000|0|R|SS00325665| 000013560240|000013560240|003|P|20|82270|0||SS00325665|... (3 Replies)
Discussion started by: nua7
3 Replies
shmop(2)							System Calls Manual							  shmop(2)

NAME
shmat(), shmdt() - shared memory operations SYNOPSIS
DESCRIPTION
attaches the shared memory segment associated with the shared memory identifier specified by shmid to the data segment of the calling process. The segment is attached for reading if (shmflg is "true"; otherwise, it is attached for reading and writing. It is not possible to attach a segment for write only. If the shared memory segment has never been attached to by any process prior to the current call, shmaddr must be specified as zero and the segment is attached at a location selected by the operating system. That location is identical in all processes accessing that shared mem- ory object. Once the operating system selects a location for a shared memory segment, the same location will be used across any subsequent and calls on the segment until it is removed by the operation of See exceptions for MPAS processes below. If this is not the first call on the shared memory segment throughout the system, shmaddr must either be zero or contain a nonzero address that is identical to the one returned from previous calls for that segment. Even if no processes are currently attached to the segment, as long as the segment has been attached before, the same rule applies. See exceptions for MPAS processes below. If the calling process is already attached to the shared memory segment, fails and returns regardless of what value is passed in shmaddr. See exceptions for MPAS processes below. detaches from the calling process's data segment the shared memory segment located at the address specified by shmaddr. Exceptions for MPAS Processes On Itanium(R)-based platforms, MPAS (Mostly Private Address Space) processes are not restricted to passing in zero or a fixed value to calls to MPAS processes may pass in other addresses. The call may fail or succeed due to implementation dependent reasons. MGAS processes have all the restrictions outlined above. In addition, an MGAS process may not assume that it can attach at the address that an MPAS process can use to attach to the same segment. An MPAS process may be able to attach to the same shared memory segment multiple times. Success or failure of such an operation is imple- mentation dependent. Failure will be indicated by a return value of An MPAS process should specify or flags in the call to These follow the same rules as such flags passed to shmget(2). See the for details. RETURN VALUE
returns the following values: Successful completion. n is the data segment start address of the attached shared memory segment. Failure. The shared memory segment is not attached. is set to indicate the error. The symbol is defined in the header No successful return from will return the value returns the following values: Successful completion. Failure. is set to indicate the error. ERRORS
If fails, is set to one of the following values. [EACCES] Operation permission is denied to the calling process. [EINVAL] shmid is not a valid shared memory identifier, (possibly because the shared memory segment was already removed using shmctl(2) with or the calling process is already attached to shmid. [EINVAL] shmaddr is not zero and the machine does not permit nonzero values, or shmaddr is not equal to the current attach location for the shared memory segment. [ENOMEM] The available data space is not large enough to accommodate the shared memory segment. [EMFILE] The number of shared memory segments attached to the calling process exceed the system-imposed limit. If fails, is set to one of the following values. [EINVAL] shmaddr is not the data segment start address of a shared memory segment. EXAMPLES
The following call to attaches the shared memory segment to the process. This example assumes the process has a valid shmid, which can be obtained by calling shmget(2). The following call to then detaches the shared memory segment. SEE ALSO
ipcs(1), exec(2), exit(2), fork(2), ftok(3C), shmctl(2), shmget(2), privileges(5). in STANDARDS CONFORMANCE
shmop(2)
All times are GMT -4. The time now is 01:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy