<?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: memory allocation 32bit vs 64bit puzzle in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/memory-allocation-32bit-vs-64bit-puzzle/m-p/3335558#M189745</link>
    <description>Your result is not too surprising in 32-bit land. In fact, I never count on more than about 512MB in 32-bit land because I plan for the worst-case. About as good as you are ever going to do is about 960MB and that is with a lightly loaded system with a "clean" heap. As the heap becomes more and more fragmented it becomes more difficult to find a single big enough chunk of memory to grant your request. I suspect that if you reboot (and start your program before anything else (e.g. oracle) is loaded) you will be able to allocate a large enough chunk. Note that you are really using a large fraction of your swap so that you may need additional swapspace. You should also make certain that your buffer cache settings are reduced to no more than about 10% (or statically set by setting a non-zero bufpages).</description>
    <pubDate>Mon, 19 Jul 2004 15:28:56 GMT</pubDate>
    <dc:creator>A. Clay Stephenson</dc:creator>
    <dc:date>2004-07-19T15:28:56Z</dc:date>
    <item>
      <title>memory allocation 32bit vs 64bit puzzle</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/memory-allocation-32bit-vs-64bit-puzzle/m-p/3335557#M189744</link>
      <description>32 bit test application cannot allocate even 660M on this machine while the same app compiled 64bit can allocate 800M.&lt;BR /&gt;&lt;BR /&gt;According to kmtune:&lt;BR /&gt;maxdsiz            0x80000000  -  0X80000000 &lt;BR /&gt;maxdsiz_64bit      0x80000000  -  0X80000000 &lt;BR /&gt;allocate_fs_swapmap         0  -  0  &lt;BR /&gt;maxswapchunks            4096  -  4096&lt;BR /&gt;nswapdev                   10  -  10 &lt;BR /&gt;nswapfs                    10  -  10 &lt;BR /&gt;remote_nfs_swap             0  -  0  &lt;BR /&gt;swapmem_on                  1  -  1  &lt;BR /&gt;swchunk                  2048  -  2048&lt;BR /&gt;&lt;BR /&gt;ulimit -Sa&lt;BR /&gt;time(seconds)        unlimited&lt;BR /&gt;file(blocks)         unlimited&lt;BR /&gt;data(kbytes)         unlimited&lt;BR /&gt;stack(kbytes)        392192&lt;BR /&gt;memory(kbytes)       unlimited&lt;BR /&gt;coredump(blocks)     4194303&lt;BR /&gt;nofiles(descriptors) 512&lt;BR /&gt;&lt;BR /&gt;cc -o memhog32 memhog.c&lt;BR /&gt;cc +DA2.0W -o memhog64 memhog.c&lt;BR /&gt;&lt;BR /&gt;./memhog64 900000 1 20&lt;BR /&gt;total space 921600000&lt;BR /&gt;Allocated 0 chunk.&lt;BR /&gt;received signal&lt;BR /&gt;&lt;BR /&gt;./memhog32 660000 1 20&lt;BR /&gt;total space 675840000&lt;BR /&gt;Allocation failed. Null pointer.: Not enough space&lt;BR /&gt;&lt;BR /&gt;Note: I have executed this test repeatedly with the same result always.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;./meminfo&lt;BR /&gt;Memory Stat      total    used   avail   %used&lt;BR /&gt;physical        2048.0  1216.8   831.2     59%&lt;BR /&gt;active virtual  2207.7  1753.9   453.9     79%&lt;BR /&gt;active real      455.5   350.8   104.7     77%&lt;BR /&gt;memory swap     1530.0   501.0  1029.0     33%&lt;BR /&gt;device swap     2048.0  1556.0   492.0     76%&lt;BR /&gt;&lt;BR /&gt;On another machine 32 bit version works happily up to almost 1024M (as expected).&lt;BR /&gt;</description>
      <pubDate>Mon, 19 Jul 2004 15:14:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/memory-allocation-32bit-vs-64bit-puzzle/m-p/3335557#M189744</guid>
      <dc:creator>Roman Guoussev-Donskoi</dc:creator>
      <dc:date>2004-07-19T15:14:15Z</dc:date>
    </item>
    <item>
      <title>Re: memory allocation 32bit vs 64bit puzzle</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/memory-allocation-32bit-vs-64bit-puzzle/m-p/3335558#M189745</link>
      <description>Your result is not too surprising in 32-bit land. In fact, I never count on more than about 512MB in 32-bit land because I plan for the worst-case. About as good as you are ever going to do is about 960MB and that is with a lightly loaded system with a "clean" heap. As the heap becomes more and more fragmented it becomes more difficult to find a single big enough chunk of memory to grant your request. I suspect that if you reboot (and start your program before anything else (e.g. oracle) is loaded) you will be able to allocate a large enough chunk. Note that you are really using a large fraction of your swap so that you may need additional swapspace. You should also make certain that your buffer cache settings are reduced to no more than about 10% (or statically set by setting a non-zero bufpages).</description>
      <pubDate>Mon, 19 Jul 2004 15:28:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/memory-allocation-32bit-vs-64bit-puzzle/m-p/3335558#M189745</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-07-19T15:28:56Z</dc:date>
    </item>
    <item>
      <title>Re: memory allocation 32bit vs 64bit puzzle</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/memory-allocation-32bit-vs-64bit-puzzle/m-p/3335559#M189746</link>
      <description>Thank you for your reply.&lt;BR /&gt;Could you please clarify some points?&lt;BR /&gt;&lt;BR /&gt;Why on the same machine 64 bit application allows to allocate more memory?&lt;BR /&gt;&lt;BR /&gt;Since both allocations are significantly less than 1G (1 quadrant size) how come 32 bit application nature come into equasion?&lt;BR /&gt;&lt;BR /&gt;Aren't 64 bit applications affected by fragmentation in the same way as 32 bit apps?&lt;BR /&gt;&lt;BR /&gt;You mention 512M (worst case).&lt;BR /&gt;Would you have any pointers where I can read more about fragmentation and about this worst case? &lt;BR /&gt;&lt;BR /&gt;Thank you.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 19 Jul 2004 16:44:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/memory-allocation-32bit-vs-64bit-puzzle/m-p/3335559#M189746</guid>
      <dc:creator>Roman Guoussev-Donskoi</dc:creator>
      <dc:date>2004-07-19T16:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: memory allocation 32bit vs 64bit puzzle</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/memory-allocation-32bit-vs-64bit-puzzle/m-p/3335560#M189747</link>
      <description>The difference is that in 64-bit land there are essentially no limits (other than maxdsiz_64bit and available virtual address space). In 32-bit land you quickly hit the 1GB quadrant limits (less any reserved space). Worst-case can be considerably worse than 512MB; that's just my personal worst worst-case. If I think I'll need to malloc/calloc/realloc more than about 512MB in 32-bit land, I typically re-think the problem and start looking at other approaches like shared memory. Of course, unless you must link with libraries for which only 32-bit versions exist, the smart play is to compile as 64-bit code so that none of these limits apply.&lt;BR /&gt;&lt;BR /&gt;Even in the case where you must use 32-bit libraries, a good approach is to split your task so that it is mainly 64-bit and fork() and exec() a 32-bit child that communicates with the parent over IPC or pipes.&lt;BR /&gt;</description>
      <pubDate>Mon, 19 Jul 2004 17:07:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/memory-allocation-32bit-vs-64bit-puzzle/m-p/3335560#M189747</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2004-07-19T17:07:12Z</dc:date>
    </item>
    <item>
      <title>Re: memory allocation 32bit vs 64bit puzzle</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/memory-allocation-32bit-vs-64bit-puzzle/m-p/3335561#M189748</link>
      <description>I understand general approach. Unfortunately I'm faced with 32bit packaged  application which I cannot change that seems to start failing on memory allocation well before hitting 1G limit.&lt;BR /&gt;&lt;BR /&gt;I have reviewed kernel params listed in my initial message and did not find anything.&lt;BR /&gt;&lt;BR /&gt;Therefore I have created a small test application to simulate memory allocation.&lt;BR /&gt;&lt;BR /&gt;At this moment I do not have a choice of changing the original packaged application but I'm requested to quantify/explain why this (32 bit) application cannot allocate even 700M total while on the same system 64 bit application can allocate 800M. Since both requests are way below 1G limit it is not at play here since requested memory is way lower.&lt;BR /&gt;&lt;BR /&gt;Are there any other factors that account for difference of maximum memory that 32 and 64 bit applications can allocate (assume total requested space is under 800M)?&lt;BR /&gt;&lt;BR /&gt;Thank you.&lt;BR /&gt;</description>
      <pubDate>Mon, 19 Jul 2004 18:45:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/memory-allocation-32bit-vs-64bit-puzzle/m-p/3335561#M189748</guid>
      <dc:creator>Roman Guoussev-Donskoi</dc:creator>
      <dc:date>2004-07-19T18:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: memory allocation 32bit vs 64bit puzzle</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/memory-allocation-32bit-vs-64bit-puzzle/m-p/3335562#M189749</link>
      <description>Keep in mind that maxssiz (which judging from your stack ulimit you've set to about 383Mb) sets aside space in the private area of 32-bit processes (usually 1Gb) to allow the stack to grow to that limit. If you want a larger data allocation, you're going to have to lower your maximum stack size.</description>
      <pubDate>Tue, 20 Jul 2004 08:43:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/memory-allocation-32bit-vs-64bit-puzzle/m-p/3335562#M189749</guid>
      <dc:creator>Don Morris_1</dc:creator>
      <dc:date>2004-07-20T08:43:51Z</dc:date>
    </item>
    <item>
      <title>Re: memory allocation 32bit vs 64bit puzzle</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/memory-allocation-32bit-vs-64bit-puzzle/m-p/3335563#M189750</link>
      <description>Thank you, Don!&lt;BR /&gt;You have hit it right in the head!&lt;BR /&gt;I'd give you 20 points if I could.</description>
      <pubDate>Tue, 20 Jul 2004 10:40:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/memory-allocation-32bit-vs-64bit-puzzle/m-p/3335563#M189750</guid>
      <dc:creator>Roman Guoussev-Donskoi</dc:creator>
      <dc:date>2004-07-20T10:40:57Z</dc:date>
    </item>
  </channel>
</rss>

