<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: problem in memory allocation in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-in-memory-allocation/m-p/5069807#M438538</link>
    <description>thanks i get it.&lt;BR /&gt;</description>
    <pubDate>Wed, 19 Sep 2007 21:11:58 GMT</pubDate>
    <dc:creator>remer</dc:creator>
    <dc:date>2007-09-19T21:11:58Z</dc:date>
    <item>
      <title>problem in memory allocation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-in-memory-allocation/m-p/5069801#M438532</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;our developer is trying to run a program that needs a memory allocation on its initialization upon running we encoutered this error.&lt;BR /&gt;&lt;BR /&gt;"attempting to initialize 1073741824 bytes of memory failed! Not enough space"&lt;BR /&gt;&lt;BR /&gt;any kernel tunables i need to adjust/change?&lt;BR /&gt;&lt;BR /&gt;thanks.</description>
      <pubDate>Wed, 19 Sep 2007 19:51:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-in-memory-allocation/m-p/5069801#M438532</guid>
      <dc:creator>remer</dc:creator>
      <dc:date>2007-09-19T19:51:10Z</dc:date>
    </item>
    <item>
      <title>Re: problem in memory allocation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-in-memory-allocation/m-p/5069802#M438533</link>
      <description>Have a look at maxdsiz (the 32-bit limit) and it's 64-bit cousin, maxdsiz_64bit. If this is 32-bit code, you need to enable more than a 1 quadrant data segment.&lt;BR /&gt;&lt;BR /&gt;You 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.</description>
      <pubDate>Wed, 19 Sep 2007 19:54:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-in-memory-allocation/m-p/5069802#M438533</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2007-09-19T19:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: problem in memory allocation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-in-memory-allocation/m-p/5069803#M438534</link>
      <description>here's the value:&lt;BR /&gt;&lt;BR /&gt;maxdsiz 1073741824  Default     Immed&lt;BR /&gt;maxdsiz_64bit 4294967296  Default     Immed&lt;BR /&gt;&lt;BR /&gt;so i need to change the value of maxdsiz into 2147483648? how about the maxdsiz_64bit what value will better?&lt;BR /&gt;&lt;BR /&gt;thanks.</description>
      <pubDate>Wed, 19 Sep 2007 19:58:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-in-memory-allocation/m-p/5069803#M438534</guid>
      <dc:creator>remer</dc:creator>
      <dc:date>2007-09-19T19:58:49Z</dc:date>
    </item>
    <item>
      <title>Re: problem in memory allocation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-in-memory-allocation/m-p/5069804#M438535</link>
      <description>Having maxdsiz_64bit set to 4GiB is a reasonable value unless you have a process that actually needs more. &lt;BR /&gt;&lt;BR /&gt;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.&lt;BR /&gt;&lt;BR /&gt;If there is a choice, have your developer compile/link this code as 64-bit and essentially all of these limits disappear.</description>
      <pubDate>Wed, 19 Sep 2007 20:06:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-in-memory-allocation/m-p/5069804#M438535</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2007-09-19T20:06:12Z</dc:date>
    </item>
    <item>
      <title>Re: problem in memory allocation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-in-memory-allocation/m-p/5069805#M438536</link>
      <description>is there a way the developer can compile as a 64-bit?&lt;BR /&gt;&lt;BR /&gt;here is the code. hope this will help.&lt;BR /&gt;&lt;BR /&gt;int main( int argc, char **argv )&lt;BR /&gt;&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;     void * mem_space = NULL;&lt;BR /&gt;&lt;BR /&gt;     int mem_size = 0;&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;     mem_size = atoi(argv[1]);&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;     mem_space = ( void * ) malloc( mem_size );&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;     if( mem_space == NULL )&lt;BR /&gt;&lt;BR /&gt;     {&lt;BR /&gt;&lt;BR /&gt;        printf( "attempting to initialize %d bytes of memory failed! %s\n", mem_size, strerror( errno ) );&lt;BR /&gt;&lt;BR /&gt;        exit( 1 );&lt;BR /&gt;&lt;BR /&gt;     }&lt;BR /&gt;&lt;BR /&gt;     else&lt;BR /&gt;&lt;BR /&gt;     {&lt;BR /&gt;&lt;BR /&gt;        printf( "attempting to initialize %d bytes of memory successful!\n", mem_size );&lt;BR /&gt;&lt;BR /&gt;        free( mem_space );&lt;BR /&gt;&lt;BR /&gt;        exit( 0 );&lt;BR /&gt;&lt;BR /&gt;     }&lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;}</description>
      <pubDate>Wed, 19 Sep 2007 20:15:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-in-memory-allocation/m-p/5069805#M438536</guid>
      <dc:creator>remer</dc:creator>
      <dc:date>2007-09-19T20:15:36Z</dc:date>
    </item>
    <item>
      <title>Re: problem in memory allocation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-in-memory-allocation/m-p/5069806#M438537</link>
      <description>First, hit your developer over the head with a baseball bat for not using header files like stdlib.h and unistd.h because the default casting of functions and their arguments is a sure-fire way to clobber 32 to 64 bit conversions.&lt;BR /&gt;&lt;BR /&gt;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).</description>
      <pubDate>Wed, 19 Sep 2007 21:07:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-in-memory-allocation/m-p/5069806#M438537</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2007-09-19T21:07:42Z</dc:date>
    </item>
    <item>
      <title>Re: problem in memory allocation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-in-memory-allocation/m-p/5069807#M438538</link>
      <description>thanks i get it.&lt;BR /&gt;</description>
      <pubDate>Wed, 19 Sep 2007 21:11:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-in-memory-allocation/m-p/5069807#M438538</guid>
      <dc:creator>remer</dc:creator>
      <dc:date>2007-09-19T21:11:58Z</dc:date>
    </item>
    <item>
      <title>Re: problem in memory allocation</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-in-memory-allocation/m-p/5069808#M438539</link>
      <description>&amp;gt;is there a way the developer can compile as a 64-bit?&lt;BR /&gt;&lt;BR /&gt;As Clay said, you need &lt;STDLIB.H&gt; and +DD64.&lt;BR /&gt;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:&lt;BR /&gt;error #4313-D: no prototype or definition in scope for call to memory allocation routine "malloc"&lt;/STDLIB.H&gt;</description>
      <pubDate>Thu, 20 Sep 2007 03:33:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-in-memory-allocation/m-p/5069808#M438539</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-09-20T03:33:42Z</dc:date>
    </item>
  </channel>
</rss>

