- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Can't allocate enough memory
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
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
тАО05-27-2003 08:28 AM
тАО05-27-2003 08:28 AM
I am using the ansi c compiler on 32-bit HP-UX 11.0 on a K580 with 4GB of memory and 12GB of swapspace. I do not want to use memory windows and I want to remain in a 32-bit OS. My problem is that no matter what I do, I cannot malloc more than about 700MB. I really need 800MB. There is plenty of memory, maxdsiz is 1GB, and I'm not swapping. Glance shows that there is plenty of memory available and even with almost no processes running on this system, I still can only allocate about 700MB. I've installed the March 2003 Quality Pack but that didn't help.
Any ideas?
Regards, Greg
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-27-2003 08:34 AM
тАО05-27-2003 08:34 AM
SolutionIf you were running 10.20 then I would say that you've done everything however in 11.x another rule applies that will limit the amount of available dynamic memory - maxssiz. As you increase maxssiz (taken from Q2) you reduce the available Q2 space. My pschic, Miss Cleo, tells me that your maxssiz setting is somewhere around 300MB. 1GB - 300MB = 700MB. Curiously near your limit. If Miss Cleo is right then drop maxssiz to about 64MB (and that is generous) and your problems will disappear.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-27-2003 09:07 AM
тАО05-27-2003 09:07 AM
Re: Can't allocate enough memory
Miss Cleo was right. Maxssiz is set to 315MB. Our programmers disagree with you and say that maxssiz has nothing to do with the available memory pool for malloc. They also say that 64MB is too small to be safe in highly recursive situations. Do you have any reference that explains why maxssiz limits malloc?
Thanks, Greg
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-27-2003 09:19 AM
тАО05-27-2003 09:19 AM
Re: Can't allocate enough memory
If I were you, I would write a baby program and attempt to allocate memory then decrease maxssiz and try again. If the 2nd attempt works then there's your answer - reference or no reference.
As to 64MB not being a big enough stack: It's your code; you can do with it what you like but those guys had better have a VERY GOOD reason to request a stack bigger than 64MB. My normal limit is 32MB and with a lot of persuasion , I'll go to 64MB. Anything above that and I can almost guarantee that you'do doing it wrong.
The exceptions to this are having to link with FORTRAN or Pascal libraries that might pass large amounts of data by value rather than by reference. If this is pure C then data structures need to be rethought. If your recursive functions need large auto data structures then, again, you probably ain't thinking about the problem the right way.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-27-2003 09:40 AM
тАО05-27-2003 09:40 AM
Re: Can't allocate enough memory
I should add that even if all the conditions are met, you still may not be able to allocate 800MB because of memory fragmentation. There may simply not be a big enough contigious chunk. In the 32-bit world, I typically only positively, absolutely count on being able to allocate about 500MB though if you play exactly by the rules something approaching 1GB is possible - if you grab the memory when it's available - like soon after a boot. Don't be surprised if you find yourself in the situation that sometimes it works and sometimes it doesn't. I can assure you that it will never work in 32-bit land w/o memory windows, if you don't reduce maxssiz.
You really should think hard about 64-bit land so that you no longer have to think about these problems.
Food for thought, Clay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-27-2003 10:26 AM
тАО05-27-2003 10:26 AM
Re: Can't allocate enough memory
It provides background to the issues Clay has brought up.
It may prove him correct and your programmers wrong.
Performance Tuning doc
http://www1.itrc.hp.com/service/cki/search.do?category=c0&docType=Security&docType=Patch&docType=EngineerNotes&docType=BugReports&docType=Hardware&docType=ReferenceMaterials&docType=ThirdParty&searchString=UPERFKBAN00000726&mode=id&admit=-682735245+1053636168960+28353475&searchCrit=allwords&printable=true
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-27-2003 11:33 AM
тАО05-27-2003 11:33 AM
Re: Can't allocate enough memory
Thanks, Greg
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-27-2003 11:46 AM
тАО05-27-2003 11:46 AM
Re: Can't allocate enough memory
You've got to be kidding me. A 200KB struct? The only thing I can think of that would do that is a huge array (or many Mama Bear size arrays) inside the struct. You should really think about dynamic arrays because I can't help but believe that much of the space in each struct is being wasted by planning for the "worst case". The goods news is that changing to pass by reference on 200KB structs should result in very obvious performance boosts.
If I am right about the arrays, I would really, really think about dynamically allocating them.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-27-2003 02:47 PM
тАО05-27-2003 02:47 PM
Re: Can't allocate enough memory
should use is to link with cc -Wl,-N or ld -N to create your program as
EXEC_MAGIC. That means that the data area starts in the first quadrant,
just above the a.out text area. That will give you almost 1GB more data
area.
If you need to get larger than that you can use "chatr +q3p enable a.out"
to make the data area extend into the third quadrant. That will mean
that the program will not be able to map in shared memory segments that
were created by other programs in the third quadrant. That limitation
is not usually a problem. (You do need some patches to enable the +q3p
feature. There are plenty of other reasons that you should already have
a new enough quality pack installed.)
The 11.11 release added another switch, "chatr +q4p enable a.out",
which can allow almost 3.75GB of data area in a 32-bit process.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-27-2003 07:26 PM
тАО05-27-2003 07:26 PM
Re: Can't allocate enough memory
Bill Hassell, sysadmin