HPE GreenLake Administration
Operating System - HP-UX
1838604
Members
4590
Online
110128
Solutions
Forums
Categories
Company
Local Language
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
06-25-2003 12:49 PM
06-25-2003 12:49 PM
swapinfo
I need to find out how 'reserve' is computed.
tusc /usr/sbin/swapinfo -r shows that only
pstat_getvminfo and pstat_getswap. How is
'reserve'value computed from pst_vminfo and
pst_swapinfo structures?
I am support JVM on HPUX and need to print out
swapinfo when we are encountering 'out of memory' error; so, I can not use popen to capture /usr/sbin/swapinfo command, because there is not enough space to execute popen command.
Thanks,
Kit Chatsinchai
tusc /usr/sbin/swapinfo -r shows that only
pstat_getvminfo and pstat_getswap. How is
'reserve'value computed from pst_vminfo and
pst_swapinfo structures?
I am support JVM on HPUX and need to print out
swapinfo when we are encountering 'out of memory' error; so, I can not use popen to capture /usr/sbin/swapinfo command, because there is not enough space to execute popen command.
Thanks,
Kit Chatsinchai
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2003 04:11 PM
06-25-2003 04:11 PM
Re: swapinfo
Hi Kit,
The basic formula to calculate the reserved field is quite simple, the implemtation in code not quite so however. I did start to write the C code but quickly realised I was basically writing swapinfo -r (as to be expected I suppose) which is not too clever. However, all the information you need can be found here:
http://www.docs.hp.com/hpux/onlinedocs/5965-4641/5965-4641.html
Look under the "Swap Space Management" section, specifically Figure 28. All the structures and definitions are defined in detail which you could use to code it.
In short the reserve field is calculated using the forumla:
reserve = swapspc_max - swapspc_cnt - (sum of used device + fs swap)
Now swapspc_max and swapspc_cnt are easily found from the pst_vminfo structure. The used device swap is harder to calculate but the information in Tables 26 & 27 can be used along with the theory described in the section.
Here is a unix cli example:
# swapinfo -tam|egrep "dev|reserve"
dev 156 45 111 29% 0 - 1 /dev/vg00/lvol2
reserve - 99 -99
# echo swapspc_max/D|adb -k /stand/vmunix /dev/kmem|tail -1
swapspc_max: 39936
# echo swapspc_cnt/D|adb -k /stand/vmunix /dev/kmem|tail -1
swapspc_cnt: 2118
swapspc_max = 39936 pages (4096 bytes) = 156 MB
swapspc_cnt = 2118 pages = 12MB
Used Device swap = 45 MB
reserve = 156 - 12 - 45 = 99MB
as shown above. Sorry I couldn't provide any code, good luck.
Regards,
James.
The basic formula to calculate the reserved field is quite simple, the implemtation in code not quite so however. I did start to write the C code but quickly realised I was basically writing swapinfo -r (as to be expected I suppose) which is not too clever. However, all the information you need can be found here:
http://www.docs.hp.com/hpux/onlinedocs/5965-4641/5965-4641.html
Look under the "Swap Space Management" section, specifically Figure 28. All the structures and definitions are defined in detail which you could use to code it.
In short the reserve field is calculated using the forumla:
reserve = swapspc_max - swapspc_cnt - (sum of used device + fs swap)
Now swapspc_max and swapspc_cnt are easily found from the pst_vminfo structure. The used device swap is harder to calculate but the information in Tables 26 & 27 can be used along with the theory described in the section.
Here is a unix cli example:
# swapinfo -tam|egrep "dev|reserve"
dev 156 45 111 29% 0 - 1 /dev/vg00/lvol2
reserve - 99 -99
# echo swapspc_max/D|adb -k /stand/vmunix /dev/kmem|tail -1
swapspc_max: 39936
# echo swapspc_cnt/D|adb -k /stand/vmunix /dev/kmem|tail -1
swapspc_cnt: 2118
swapspc_max = 39936 pages (4096 bytes) = 156 MB
swapspc_cnt = 2118 pages = 12MB
Used Device swap = 45 MB
reserve = 156 - 12 - 45 = 99MB
as shown above. Sorry I couldn't provide any code, good luck.
Regards,
James.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2003 06:25 PM
06-25-2003 06:25 PM
Re: swapinfo
"Out of memory" are almost always due to maxdsiz or asking for more memory (local or shared) than the excutable allows. You can verify this by simply adding a couple of Gbytes of filesystem swapspace temporarily. Let's start with maxdsiz: for 32 bit programs, it is the maximum amount of data space that can be requested from the system. The default value is far too small (64 megs), so change maxdsiz in the kernel to 900 megs, regen the kernel and reboot. Your programmers should be able to tell you how much RAM the program needs.
Standard 32bit programs can request up to 940 megs (assuming maxdsiz is 940 megs or larger). 64bit programs have no practical limit (hundreds of Gbytes) for local data. To go beyond 940 megs, you'll need to print the two white papers on memory and process management found in /usr/share/doc. Look specifically for EXEC_MAGIC, DEMAND_MAGIC, SHARE_MAGIC and SHMEM_MAGIC and comments about loader and chatr options.
Note that shared memory is quire different: 940 megs is the limit but this memory is mapped into a common memory addressing space and thus shared by many other uses including memory mapped files, shared libraries and shared memory segments. Fragmentation (for 32bit programs) is a big problem and commonly generates "out of memory" errors.
Note that programs which need large amounts of swap space will be VERY slow when they run.
Bill Hassell, sysadmin
Standard 32bit programs can request up to 940 megs (assuming maxdsiz is 940 megs or larger). 64bit programs have no practical limit (hundreds of Gbytes) for local data. To go beyond 940 megs, you'll need to print the two white papers on memory and process management found in /usr/share/doc. Look specifically for EXEC_MAGIC, DEMAND_MAGIC, SHARE_MAGIC and SHMEM_MAGIC and comments about loader and chatr options.
Note that shared memory is quire different: 940 megs is the limit but this memory is mapped into a common memory addressing space and thus shared by many other uses including memory mapped files, shared libraries and shared memory segments. Fragmentation (for 32bit programs) is a big problem and commonly generates "out of memory" errors.
Note that programs which need large amounts of swap space will be VERY slow when they run.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2003 09:18 AM
06-26-2003 09:18 AM
Re: swapinfo
James,
Thank you very much for your help. What I did not
mentioned was that this was related to a Java critical JAG defect that I am fixing.
Many thanks,
Kit Chatsinchai
Thank you very much for your help. What I did not
mentioned was that this was related to a Java critical JAG defect that I am fixing.
Many thanks,
Kit Chatsinchai
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP