General
cancel
Showing results for 
Search instead for 
Did you mean: 

Why stack is so big under HP IA 64!

sohochaser1
Occasional Advisor

Why stack is so big under HP IA 64!

I use the command procsize -p processID to get the memory usage of my programme. No matter the programme is simple or complicated, the STACK of the command "procsize -p processID" is alway is about 98M? Even my programme just wrote a string to a file?

Is there any system variable I should set if I want the stack is getiing smmaller/

Thanks in advance.
6 REPLIES
Hein van den Heuvel
Honored Contributor

Re: Why stack is so big under HP IA 64!

Teh displayed Stack variable may well be maximum virtual memory. It may only take as much real memory as the process really needs.

procsize is not an hpux provided tool. The version I have is PA-RISC and does nto run directly on my Itanium to try.

similar topic:
http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1266871

hth,
Hein.
Don Morris_1
Honored Contributor

Re: Why stack is so big under HP IA 64!

Yes -- IPF stacks are created with the maximum virtual size by the kernel (without going into gory internals... they grow from high to low addresses, nothing else does -- and the metadata simply doesn't support that well... so it is a great deal simpler to only grow them physically). They're also created as lazy swap -- so there's no cost to this. [On PA, the stack virtual address space required is reserved and swap is reserved when the stack grows... so this is functionally identical].

Hence if you look solely at the virtual size of the stack, you will see it at maxssiz or maxssiz_64bit depending if the process is 32 or 64-bit (and what the value was at the time of the process starting if you've changed it). If procsize has an option to private RES (physical memory consumption) you should see much more variety in stack consumption (and for simply programs probably only 1 to 4 pages).

You could make it lower by lowering maxssiz... but unless you really need to, there's very little point.
Dennis Handly
Acclaimed Contributor

Re: Why stack is so big under HP IA 64!

There are 3 types of stacks on IPF:
1) The normal stack, maxssiz
2) The RSE stack, maxrsessiz
3) Thread stacks, which are smaller copies of 1) & 2).

>Don: You could make it lower by lowering maxssiz but unless you really need to, there's very little point.

One reason not to have large maxssiz is that if your maxdsiz is >= 1 Gb, every byte in maxssiz reduces maxdsiz.
prasadb
Super Advisor

Re: Why stack is so big under HP IA 64!

Dear sohochaser1 ,
forgot to assign points ?
sohochaser1
Occasional Advisor

Re: Why stack is so big under HP IA 64!

I think the problem is related to the parmeters.
-V Display the virtual set size info (default)
-R Display the Resident set size info

The default is -V, so the displayed stack may not true. It that correct?

Besides, is there any tools can be used to make memory cosum between different paltforms? Such as Linux, HP, Solaris and so on.

Dennis Handly
Acclaimed Contributor

Re: Why stack is so big under HP IA 64!

>-R Display the Resident set size info
>so the displayed stack may not true.

It seems this will give how much is actually used.

>is there any tools can be used to make memory cosum between different platforms?

To show memory consumption? They are probably all different. There is glance.