Operating System - HP-UX
1847088 Members
5384 Online
110262 Solutions
New Discussion

Re: Memory resource analysis - ideas please?

 
phil cook
Frequent Advisor

Memory resource analysis - ideas please?

Hi - Wondering if anybody can help with a problem I have. I'm trying to quantify the amount of memory used by a dormant Oracle sql-net session.

i.e when a client logs into an Oracle database a stub processexists on the host to handle traffic to that client. What I'm trying to establish is the impact one stub has in terms of memory only, with a view to predicting a volume of users at which point the machine will experience problems.

I've can identify a dormant stub easily enough by watching it's cpu utilisation. I have then tried using glance, top & ps to determine the memory usage, but I'm getting very different figures from each tool.

I think I understand the difference between data, text & stack. & I've grasped RSS & VSS. It would also be useful if I could determine the page size this machine is using, I know in 11.00 this is a kernel parameter, but I'm running 10.20.

Can anyone suggest anything based on experience? If I can reach a final verdict over the amount of memory used, what borderline do I use to extrapolate my user limits? Is it reserved memory?

If you can help I'd be grateful - thanks

Phil C
Do I have to?
8 REPLIES 8
MANOJ SRIVASTAVA
Honored Contributor

Re: Memory resource analysis - ideas please?

Hi Phil


The simple way is to give the command ( i got this from the forums itself ):

UNIX95= ps -e -o ruser,vsz,pid,args | sort -rnk2 | grep to the procees you want to check.

You can add the memory used by each user processes and since it is directly from the ps it is on the fly.

Manoj Srivastava
Jim Turner
HPE Pro

Re: Memory resource analysis - ideas please?

Phil,

Similar in form and function to the previous answer:

ps -elf | sort -rn -k10 | more

Column 10 will indicate each proc's memory usage in 4k pages.

Cheers,
Jim
phil cook
Frequent Advisor

Re: Memory resource analysis - ideas please?

Thanks for your help. I have used ps in the end, bit confusd by all the different readings, but eventually got a grip looking at the M page in glance (process memory usage).

Used ps to repeatedly sample to get hold of my dormant processes, then glance.

Basing my final calculation on an as yet unknown figure for maximum recommended reserved swap. Also need to know the recommended ratio of memory/swap. Any ideas?

Cheers

Phil
Do I have to?
Ronald Bolante
Occasional Advisor

Re: Memory resource analysis - ideas please?

hi... why don't you use the "top" system call? there are many options supported by this command and i think you can view all the necessary resources you need to know... hope this might help... more power...
JAYAMOHAN.V.D
Occasional Advisor

Re: Memory resource analysis - ideas please?

hi,
the memory to swap ratio is mainly depends on the application, and the physical memory u r having. its better to keep a swap of double the size of physical memory.
regards
jayamohan
James R. Ferguson
Acclaimed Contributor

Re: Memory resource analysis - ideas please?

Hi Phil:

The memory reported by 'top', 'glance', ps' and 'vmstat' require some interpretation before you can compare their values.

Take a look at Technical Knowledge Base document #A4678152 ("Comparing page size for vmstat, top, glance, ps -el").

/begin_quote/

1. Top reports free memory in 1kb chunks so to get them to match you must divide tops free amount by 4 to get the true number of 4kb pages free and have it match vmstat. In other words, top reports in 1kb pages so these numbers must be multiplied by 4 to get 4kb kernel pages numbers.

2. For vmstat, avm (active virtual pages) and free (size of the free list) memory are reported in 4kb pages sizes.

3. Glance reports 1kb page sizes. This number will often be significantly different from ps -el since glance reports usage of shared memory also.

From the Glance help window for RSS (* PROC_MEM_RES): The number of KB of resident memory for the process. This consists of text, data, stack, as well as the process' portion of shared memory. This value is similar to the SZ field of the ps -el command, except that the ps command shows only data, stack, and text areas, and it reports their sizes in page units rather than KB. On some systems ps reports the virtual rather than
resident size.

4. ps -el reports in 4kb kernel page sizes.

/end_quote/

...JRF...
Bill Hassell
Honored Contributor

Re: Memory resource analysis - ideas please?

Swap space is very simple to calculate, and no, it has nothing to do with a ratio between RAM and swap. Since HP-UX is a virtual memory system, the maximum amount of programs that can run at the same time is defined by swap space. There is a kernel parameter that can append up to 7/8 of RAM to the swap total, which effectively extends this maximum virtual memory.

The parameter is swapmem_on and when set to zero, swap space solely defines the amount of processes that can be run at the same time. If swapmem_on=1, then 7/8 RAM + swap defines the maximum value.

Now being able to run 50 Gbytes of processes at the same time is a feature of HP-UX but it comes with an obvious penalty: paging out and back. So the decision is easy--total the maximum number of processes times amount of RAM needed, then make sure you have enough virtual memory to hold it all.

Performance is simple: if all the processes that must run quickly will fit in RAM at the same time, all is well. If not, buy more RAM. This is not a run/not-run question. All those processes will run at the same time, but perhaps incredibly slow. So when the system starts to slow down, wmstat or Glance will show page outs. Buy RAM as neeed.


Bill Hassell, sysadmin
phil cook
Frequent Advisor

Re: Memory resource analysis - ideas please?

Thanks to everyone for their advice - been a useful exercise for me!

Cheers
Do I have to?