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:
# The space character after UNIX95= is mandatory
UNIX95= ps -e -o vsz | grep -v "VSZ"
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 ----------
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.
You did not respect the correct syntax: UNIX95= ps -e.....
so type exactely what was given by methyl:
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?
==> 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
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 ?
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...
ant:/home/vbe $ ioscan -funC fc
Class I H/W Path Driver S/W State H/W Type Description
=================================================================
fc 0 0/4/0/0 td CLAIMED INTERFACE HP Tachyon XL2 Fibre Channel Mass Storage Adapter
/dev/td0
fc 1 0/7/0/0 td CLAIMED INTERFACE HP Tachyon XL2 Fibre Channel Mass Storage Adapter
/dev/td1