- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: problem in memory allocation
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
09-19-2007 12:51 PM
09-19-2007 12:51 PM
our developer is trying to run a program that needs a memory allocation on its initialization upon running we encoutered this error.
"attempting to initialize 1073741824 bytes of memory failed! Not enough space"
any kernel tunables i need to adjust/change?
thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2007 12:54 PM
09-19-2007 12:54 PM
SolutionYou could also be hitting ulimit or (more rarely a lack of swap space). Any of these can cause malloc() or its relatives to set errno = ENOMEM but I'm betting that you are either hitting maxdsiz or a quadrant.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2007 12:58 PM
09-19-2007 12:58 PM
Re: problem in memory allocation
maxdsiz 1073741824 Default Immed
maxdsiz_64bit 4294967296 Default Immed
so i need to change the value of maxdsiz into 2147483648? how about the maxdsiz_64bit what value will better?
thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2007 01:06 PM
09-19-2007 01:06 PM
Re: problem in memory allocation
One thing to be aware of is (especially in 32-bit code) is that the stack and data segments are allocated from the same quadrant by default. This means that if you set maxssiz to 256MiB, for example, that the amount of space that can be allocated is decreased by 256MiB regardless of whether the run-time stack ever approaches the 256MiB value. A reasonable value for maxssiz is 32MiB and 128MiB for maxssiz_64bit. These are extremely generourous as only poorly written code would ever need stacks larger than this.
If there is a choice, have your developer compile/link this code as 64-bit and essentially all of these limits disappear.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2007 01:15 PM
09-19-2007 01:15 PM
Re: problem in memory allocation
here is the code. hope this will help.
int main( int argc, char **argv )
{
void * mem_space = NULL;
int mem_size = 0;
mem_size = atoi(argv[1]);
mem_space = ( void * ) malloc( mem_size );
if( mem_space == NULL )
{
printf( "attempting to initialize %d bytes of memory failed! %s\n", mem_size, strerror( errno ) );
exit( 1 );
}
else
{
printf( "attempting to initialize %d bytes of memory successful!\n", mem_size );
free( mem_space );
exit( 0 );
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2007 02:07 PM
09-19-2007 02:07 PM
Re: problem in memory allocation
I have no idea how to tell you how to enable 64-bit code because you haven't bothered to identify your compiler. It really doesn't matter because you should be asking the box rather than some idiot on the Internet anyway. Do a man gcc or man aCC or whatever and it should be obvious what compiler flags are needed (e.g. +DD64).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2007 02:11 PM
09-19-2007 02:11 PM
Re: problem in memory allocation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2007 08:33 PM
09-19-2007 08:33 PM
Re: problem in memory allocation
As Clay said, you need
And to make Clay happy, if you don't have a prototype for the heap functions, A.06.15 has made it a hard error in 64 bit mode:
error #4313-D: no prototype or definition in scope for call to memory allocation routine "malloc"