- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Unable to allocate memory, HP-UX B.11.11 U 9000/8...
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
Forums
Discussions
Discussions
Discussions
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
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
11-24-2008 03:49 PM
11-24-2008 03:49 PM
My application is trying to allocate an array of size 953773 where each array element is 104 bytes each. However, the new operator throws an error.
The output of memprog on this machine is:
Memory Stat total used avail %used
physical 36288.0 13705.0 22583.0 38%
active virtual 12030.6 882.7 11147.8 7%
active real 2617.2 730.6 1886.5 28%
memory swap 28019.2 7420.9 20598.2 26%
device swap 32768.0 5982.5 26785.5 18%
Can anybody please advise how to investigate this problem further?
Thanks in advance.
-Shiv
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2008 03:53 PM
- Tags:
- maxdsiz
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2008 04:20 PM
11-24-2008 04:20 PM
Re: Unable to allocate memory, HP-UX B.11.11 U 9000/800
> However, the new operator throws an error.
It's always nice to specify an error number ('errno') though in this case your failure is likely to be either insufficient swap space or too small a 'maxdsiz'. If swap space is sufficient look at 'maxdsiz' if your process is a 32-bit one. Otherwise, if your process is a 64-bit one, look at the value of 'maxdsiz_64bit'.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2008 04:35 PM
11-24-2008 04:35 PM
Re: Unable to allocate memory, HP-UX B.11.11 U 9000/800
Here's the output of swapinfo -tam:
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 8192 38 8154 0% 0 - 1 /dev/vg00/lvol11
dev 8192 38 8154 0% 0 - 1 /dev/vg01/lvol12
dev 16384 0 16384 0% 0 - 2 /dev/vg01/lvol17
reserve - 5993 -5993
memory 28019 7421 20598 26%
total 60787 13490 47297 22% - 0 -
How do I find the maxdsize for 64 bit?
-Shiv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2008 04:37 PM
11-24-2008 04:37 PM
Re: Unable to allocate memory, HP-UX B.11.11 U 9000/800
The error thrown from the default operator new, bad_alloc, which means malloc returned NULL.
But that doesn't distinguish between the maxdsiz limit or out of swap space.
- Tags:
- bad_alloc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2008 04:40 PM
11-24-2008 04:40 PM
Re: Unable to allocate memory, HP-UX B.11.11 U 9000/800
You have plenty of swap. Did you run this at the same time as your application abort?
>How do I find the maxdsiz for 64 bit?
kmtune | fgrep maxdsiz
If your process is 64 bit and you are running out of space, you have major problems.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2008 04:46 PM
11-24-2008 04:46 PM
Re: Unable to allocate memory, HP-UX B.11.11 U 9000/800
> Dennis: But that doesn't distinguish between the maxdsiz limit or out of swap space.
Yup, I certainly didn't say that well --- only that in this case the errno is probably ENOMEM and that indicates "either".
I was trying to point out that descriptions like "throws an error" are too general when good coding techniques can report the exact error which, in turn, then can be uplifted to good problem descriptions.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2008 04:53 PM
11-24-2008 04:53 PM
Re: Unable to allocate memory, HP-UX B.11.11 U 9000/800
Mb Mb Mb PCT START/ Mb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 8192 38 8154 0% 0 - 1 /dev/vg00/lvol11
dev 8192 38 8154 0% 0 - 1 /dev/vg01/lvol12
dev 16384 0 16384 0% 0 - 2 /dev/vg01/lvol17
reserve - 5991 -5991
memory 28019 7421 20598 26%
total 60787 13488 47299 22% - 0 -
kmtune output is:
$ kmtune | grep maxdsiz
maxdsiz 1073741824 - 1073741824
maxdsiz_64bit 4294967296 - 4294967296
-Shiv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2008 04:58 PM
11-24-2008 04:58 PM
Re: Unable to allocate memory, HP-UX B.11.11 U 9000/800
Is your process a 32-bit one?
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2008 04:59 PM
11-24-2008 04:59 PM
Re: Unable to allocate memory, HP-UX B.11.11 U 9000/800
-Shiv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2008 05:12 PM
11-24-2008 05:12 PM
Re: Unable to allocate memory, HP-UX B.11.11 U 9000/800
You said it well, I'm saying that libc and the aC++ runtime only tells you "black".
>I was trying to point out that descriptions like "throws an error" are too general
In this case "throws an error" is EXACTLY what the aC++ runtime does. But it only throws the color "black", bad_alloc.
> ShivS: The swapinfo -tam output when my application aborted:
>total 60787 13488 47299 22%
>maxdsiz 1 Gb
>maxdsiz_64bit 4 Gb
This says you are not out of swap, so the only answer is that you are very greedy. :-)
You are using more than 1 Gb or 4 Gb for a 64 bit executable.
You may want to look at the top(1) output as your application runs.
If you need more than 1 Gb, you can increase maxdsiz to 4 Gb and link with -N, to get to 2 Gb.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2008 05:15 PM
11-24-2008 05:15 PM
Re: Unable to allocate memory, HP-UX B.11.11 U 9000/800
(You have compiled with +DD64?)
Then you need to increase maxdsiz_64bit. Do you have any idea how much memory you need? You could try 8 Gb.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2008 08:27 AM
11-25-2008 08:27 AM
Re: Unable to allocate memory, HP-UX B.11.11 U 9000/800
Can you please tell me all the commands?
>JRF: (You have compiled with +DD64?)
>JRF: Then you need to increase maxdsiz_64bit. Do you have any idea how much memory you need? You could try 8 Gb.
Yes, I have compiled with +DD64. I can try 8 GB.
Regards,
Shiv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2008 11:39 AM
11-25-2008 11:39 AM
Re: Unable to allocate memory, HP-UX B.11.11 U 9000/800
>I have compiled with +DD64. I can try 8 GB.
You go into SAM and increase maxdsiz_64bit and it will reboot.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2008 12:01 PM
11-25-2008 12:01 PM
Re: Unable to allocate memory, HP-UX B.11.11 U 9000/800
Thanks a lot for all your help.
Regards,
Shiv.