cancel
Showing results for 
Search instead for 
Did you mean: 

data segment usage

Praveen Bezawada
Respected Contributor

data segment usage

Hi
What can we know the amount of data segment and dynamic stack segment is being used.
We need these to change the values of maxdsiz and maxssiz.

Praveen
2 REPLIES
A. Clay Stephenson
Acclaimed Contributor

Re: data segment usage

Hi,

Essentially all of the run-time tools (top, ps, glance) can only give you totals. If the code was compiled with profiling diagnostics are possible. It is almost impossible to monitor statck usage as this changes from moment to moment and is data dependent. In any event, it does no harm whatsoever (and consumes no resources) to set maxdsiz, maxtsiz, and maxssiz quite large). It is very ununusual for maxssiz to need to exceed 64MB and 512MB is a large maxdsiz. You can go bigger still and it does no harm. The only downside to very large values is that a runaway memory hog will not die as quickly and thus tie up resources for a longer period.

Clay
If it ain't broke, I can fix that.

Re: data segment usage

You could use pst_status::pst_vdsize and pst_status::pst_vssize as populated by pstat_getproc( ) and multiply those page counts by pst_static::page_size as populated by pstat_getstatic( ).

If you don't want to use the pstat_* interfaces for any reason or if you have threads, here's a URL from within the HPUX-DEVTOOLS list archives:
http://devresource.hp.com/CXX/Forums/hpux-devtools/hpux-devtools.0105/0155.html