08-26-2009 10:51 AM
If I understand your question, you need to examine:
# ulimit -a
...with regard to 'data' (for the heap) and perhaps (though unlikely) for the 'stack'. These are your "soft" limits.
The kernel parameters 'maxdsiz' and 'maxssiz' govern the "hard" limits for these respectively, for 32-bit processes. 'maxdsiz_64bit' and 'maxssiz_64bit' are the hard limits for 64-bit processes.
08-26-2009 03:29 PM
If you have static storage duration variables, these increase your VSZ.
As JRF says, if these are large, you may have to increase maxdsiz.
08-27-2009 09:50 AM
Actually we are trying to optimise memory taken by processes .
Some of static variables are arrays which are initialised at the declaration itself and used by all functions in the file .
Is there way to optimise this memory consumption ? If we make these arrays as local , it would be problem for runtime allocation on stack .
Also how do we typically optimise the memory taken by processes .
Also we are using pmap to study the memory utilisation . is there better tool
08-27-2009 10:08 PM
How many users of the program are running at once? How much memory?
>Some of static variables are arrays which are initialised at the declaration itself and used by all functions in the file.
Is this read only data? If so, add const.
>If we make these arrays as local, it would be problem for runtime allocation on stack.
The stack would have to be made big enough and you would have to initialize your arrays on every call.
>how do we typically optimise the memory taken by processes.
Allocate it on the heap when you need it.
>is there better tool
For static storage, you can just use size(1).
For heap, you can use mallinfo(3).