[Solved] Adding a column.


Login or Register for Dates, Times and to Reply

 
Thread Tools Search this Thread
Operating Systems HP-UX [Solved] Adding a column.
# 8  
I don't think that HP-UX top is suitable for further processing because the output is formatted with VDU control sequences and only the first page of process list is output.

What figure are you trying to calculate? The sum of the running sizes of processes really has no meaning on a paged Operating System.


Footnote: The output from the Berkeley format ps command is easier to deal with in scripts:
For example: Size of each process in 1024 byte units:
Code:
# The space character after UNIX95= is mandatory
UNIX95= ps -e -o vsz | grep -v "VSZ"

These 2 Users Gave Thanks to methyl For This Post:
# 9  
Question

Is this output correct ?

Code:
top |  awk '{ if ($7 ~ /K/) { {sum+=($7*1024)}}else{if ($7 ~ /M/){ {sum+=($7*1024*1024)}} else { sum+=$7}}}END { print (sum/(1024*1024*1024)) "GB"}' top.out
59.3392GB

If yes, that means I have close to 60 GB of heap under use. Does that mean I better have 60 GB of swap memory for us not to fall short in the future ?

Correct me and suggest if you disagree.

---------- Post updated at 03:17 AM ---------- Previous update was at 03:16 AM ----------

Quote:
Originally Posted by methyl
I don't think that HP-UX top is suitable for further processing because the output is formatted with VDU control sequences and only the first page of process list is output.

What figure are you trying to calculate? The sum of the running sizes of processes really has no meaning on a paged Operating System.


Footnote: The output from the Berkeley format ps command is easier to deal with in scripts:
For example: Size of each process in 1024 byte units:
Code:
# The space character after UNIX95= is mandatory
UNIX95= ps -e -o vsz | grep -v "VSZ"


As I said, I have a few java processess running. Off-late I increased the number of java processes. This lead to 99 % swap memory consumption. Now, I need to suggest what is the amount of swap that needs to be increased inorder to suffice the current running java processes.

methyl did you ask me to run ??

Code:
==>  ps -e -o vsz | grep -v "VSZ"
ps: illegal option -- o
usage: ps [-edaxzflP] [-u ulist] [-g glist] [-p plist] [-t tlist] [-R prmgroup] [-Z psetidlist]

# 10  
You did not respect the correct syntax: UNIX95= ps -e.....

so type exactely what was given by methyl:
Code:
UNIX95= ps -e -o vsz | grep -v "VSZ"

If you were to summ all the processes memory usage, then I certainly would not have used top... and if that were what you are trying, I am sure I already gave the solution here using XPG4 syntax ( the one methyl is trying to get you use...) did you search before asking?

Last edited by vbe; 09-10-2012 at 06:31 AM..
# 11  
Question

Quote:
Originally Posted by vbe
You did not respect the correct syntax: UNIX95= ps -e.....

so type exactely what was given by methyl:
Code:
UNIX95= ps -e -o vsz | grep -v "VSZ"

If you were to sum all the processes memory usage, then I certainly would not have used top... and if that were what you are trying, I am sure I already gave the solution here using XPG4 syntax ( the one methyl is trying to get you use...) did you search before asking?

I am sorry for the miss. Find my output below.

Code:
==> UNIX95= ps -e -o vsz | grep -v "VSZ" | awk '{ sum += $0 } END { print sum }'
6.52404e+07

If the output is in bytes I used google to convert bytes to MBs and it says

Code:
62.218093872 MBs

This does not look feasible. The heap used by the scripts that I am currently running has to be any amount greater than 2 GB. Am I missing something ?

This is contrary to the command provided by "pamu" which showed around 59 GB of heap consumption on the system.



Also, if I wanted to ask if I have a script that starts the JVM with initial heap -xms 256MB and Maximum Heap -xmx 512MB and the current heap utilisation is 300MB what will this command count for this process 256, 300 or 512 MB ?

Last edited by mohtashims; 09-10-2012 at 09:57 AM..
# 12  
6.52404e+07 is around 64 GB... what are you calculating?

Could you give us your output of the following command:
Code:
swapinfo -tam


Last edited by vbe; 09-10-2012 at 10:51 AM..
# 13  
Quote:
Originally Posted by vbe
6.52404e+07 is around 64 GB... what are you calculating?
I understood that this output
Code:
6.52404e+07

is in bytes and hence I tried to use google converter to convert it in Mbs so the google coverter showed
Code:
62.218093872 MBs

May I know how were you able to convert
Code:
6.52404e+07

to around
Code:
64 GB

?

Quote:
Originally Posted by vbe
Could you give us your output of the following command:
Code:
swapinfo -tam

Here is the output

Code:
==> swapinfo -tam
             Mb         Mb         Mb   PCT    START/       Mb
TYPE      AVAIL    USED     FREE  USED   LIMIT   RESERVE  PRI  NAME
dev        8000      0      7992    0%     0        -     1    /dev/vg00/swap
reserve     -       7992   -7992
memory    61678    51592   10086   84%
total     69678    59584   10086   86%     -       0       -


Last edited by mohtashims; 09-11-2012 at 03:44 AM..
# 14  
OK...
Are you on a SAN?
I guess you have memory issues though you have pleanty of...
Since changing your original swap space may be very tricky... for perfomance reason, I suggest you create new swap spaces NOT in vg00: 2 will help a lot, 4 would be perfect, for that, they must be the same size as the one in vg00 so if you have the 4 new swaps preferably in different groups of disks ( load balancing) you would have 40 GB device swap instead of 8... HPUX is a virtual memory system... It reseves in swap the space needed for each process it is going to run, So once it filled you 8GB, if you look at your kernel parameters, I am sur you have swap_mem set to 1, this allows the system to extend the swap area in memory... Doing that you find yourself not being able to load new applications or processes by getting the system replying "Not enough memory" though you have plenty... In ither words if you intent to use all your memory for processes, then you need at least the same amount of device swap..., in your case it would be silly though... So start with what I suggested above and you will see your life change...
This User Gave Thanks to vbe For This Post:
Login or Register for Dates, Times and to Reply

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #229
Difficulty: Easy
According to NetMarketShare, in September 2019 Linux had a 2% global market share of the desktop / laptop computer market.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Adding values of a column based on another column

Hello, I have a data such as this: ENSGALG00000000189 329 G A 4 2 0 ENSGALG00000000189 518 T C 5 1 0 ENSGALG00000000189 1104 G A 5 1 0 ENSGALG00000000187 3687 G T 5 1 0 ENSGALG00000000187 4533 A T 4 2 0 ENSGALG00000000233 5811 T C 4 2 0 ENSGALG00000000233 5998 C A 5 1 0 I want to... (3 Replies)
Discussion started by: Homa
3 Replies

2. Linux

[SOLVED] Trouble adding Tun module

So I have Ubuntu running on a sheevaplug develop kit, but the damn kernel thing doesn't come with /dev/tun enabled. It was suggested that I look into using module assistant to compile & get this set up but I'm having issues. Linux ubuntu 2.6.39.4 #2 PREEMPT Fri Aug 5 19:05:11 MDT 2011 armv5tel... (4 Replies)
Discussion started by: dpreviti
4 Replies

3. Hardware

[solved] Sun Netra X1 - Adding a Second Hard Drive

As the title suggests, I'm trying to install a second drive (really want an OS mirror) on a Sun Netra X1. I've taken the spacer out, and had a go at with the drill-press so now I have a nice HDD tray. Have installed an IDE drive in the tray, plugged in the power and data cables that were... (0 Replies)
Discussion started by: Smiling Dragon
0 Replies

4. Shell Programming and Scripting

[Solved] Password query even after adding public key

Dears I am running a shell script to backup (transfer) files to a networked External HDD. Even though the public key has been added it still asks for the password before starting the transfer. Any suggestions? Thanks in advance. (8 Replies)
Discussion started by: BrownBob
8 Replies

5. Shell Programming and Scripting

[Solved] Sorting a column based on another column

hello, I have a file as follows: F0100010 A C F0100040 A G BTA-28763-no-rs 77.2692 F0100020 A G F0100030 A T BTA-29334-no-rs 11.4989 F0100030 A T F0100020 A G BTA-29515-no-rs 127.006 F0100040 A G F0100010 A C BTA-29644-no-rs 7.29827 F0100050 A... (9 Replies)
Discussion started by: Homa
9 Replies

6. UNIX for Dummies Questions & Answers

[Solved] Deleting all rows where the first column equals the second column

Hi, I have a tab delimited text file where the first two columns equal numbers. I want to delete all rows where the value in the first column equals the second column. How do I go about doing that? Thanks! Input: 1 1 ABC DEF 2 2 IJK LMN 1 2 ZYX OPW Output: 1 2 ZYX OPW (2 Replies)
Discussion started by: evelibertine
2 Replies

7. Shell Programming and Scripting

[Solved] adding email option to KSH

Hi, I wanted to add a email option to this script. and was wondering if anyone could help me out. #!/bin/ksh echo "Finding hdisk" <DIR>/find-disk i=1 b=0 p=0 while ... (2 Replies)
Discussion started by: vpundit
2 Replies

8. UNIX for Dummies Questions & Answers

[Solved] Adding time stamp to file name

I have the awk awk -F\* '$1=="ST",$1=="SE"{if($1=="ST"){close(f);f="sample" ++i} ; $1=$1; print>f}' OFS=\| <filename> How to add the time stamp to the file name mentioned as "sample" Please view this code tag video for how to use code tags when posting code and data. (6 Replies)
Discussion started by: atlantis_yy
6 Replies

9. UNIX for Dummies Questions & Answers

Rename a header column by adding another column entry to the header column name

Hi All, I have a file example.csv which looks like this GrpID,TargetID,Signal,Avg_Num CSCH74_1_1,2007,61,256 CSCH74_1_1,212007,647,679 CSCH74_1_1,12007,3,32 CSCH74_1_1,207,299,777 I want the output as GrpID,TragetID,Signal-CSCH74_1_1,Avg_Num CSCH74_1_1,2007,61,256... (1 Reply)
Discussion started by: Vavad
1 Replies

10. Shell Programming and Scripting

Rename a header column by adding another column entry to the header column name URGENT!!

Hi All, I have a file example.csv which looks like this GrpID,TargetID,Signal,Avg_Num CSCH74_1_1,2007,61,256 CSCH74_1_1,212007,647,679 CSCH74_1_1,12007,3,32 CSCH74_1_1,207,299,777 I want the output as GrpID,TragetID,Signal-CSCH74_1_1,Avg_Num CSCH74_1_1,2007,61,256... (4 Replies)
Discussion started by: Vavad
4 Replies

Featured Tech Videos