- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- static variables - VSZ and RSZ size
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-26-2009 10:33 AM
тАО08-26-2009 10:33 AM
static variables - VSZ and RSZ size
If we have static global variables in our program , will we have increase the VSZ/RSZ memory of our program
- Tags:
- variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-26-2009 10:51 AM
тАО08-26-2009 10:51 AM
Re: static variables - VSZ and RSZ size
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.
http://docs.hp.com/en/B2355-60130/maxdsiz.5.html
http://docs.hp.com/en/B2355-60130/maxssiz.5.html
http://docs.hp.com/en/B2355-60130/sh-posix.1.html
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-26-2009 03:29 PM
тАО08-26-2009 03:29 PM
Re: static variables - VSZ and RSZ size
If you have static storage duration variables, these increase your VSZ.
As JRF says, if these are large, you may have to increase maxdsiz.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-27-2009 09:50 AM
тАО08-27-2009 09:50 AM
Re: static variables - VSZ and RSZ size
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-27-2009 10:08 PM
тАО08-27-2009 10:08 PM
Re: static variables - VSZ and RSZ size
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).