<?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: HP UX PA2.0 64 Bit / malloc failed to allocate 4 GB memory in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/hp-ux-pa2-0-64-bit-malloc-failed-to-allocate-4-gb-memory/m-p/5106688#M690341</link>
    <description>Thanks Morris. I will try your suggestions.&lt;BR /&gt;&lt;BR /&gt;I am curious about why -N should be ignored, it worked well with 32 bit programs earlier.&lt;BR /&gt;&lt;BR /&gt;Is it because a 64 bit program has more memory access than 32 bit, MAGIC etc. are applicable only to 32 bit ?&lt;BR /&gt;Or is it because I am using -N for a wrong type of program.&lt;BR /&gt;&lt;BR /&gt;bash-3.00$ cc memtest.c +DA2.0W -N -o ./memtest&lt;BR /&gt;ld: (Warning) Option "-N" ignored. Non-shared text is not supported.&lt;BR /&gt;1 warnings.&lt;BR /&gt;&lt;BR /&gt;Rgds,&lt;BR /&gt;Srini&lt;BR /&gt;</description>
    <pubDate>Thu, 01 May 2008 20:58:09 GMT</pubDate>
    <dc:creator>scoolj</dc:creator>
    <dc:date>2008-05-01T20:58:09Z</dc:date>
    <item>
      <title>HP UX PA2.0 64 Bit / malloc failed to allocate 4 GB memory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/hp-ux-pa2-0-64-bit-malloc-failed-to-allocate-4-gb-memory/m-p/5106686#M690339</link>
      <description>As a part of debugging a customer's problem, I wrote a simple program to allocate 4GB of memory, but it failed to allocate.&lt;BR /&gt;&lt;BR /&gt;It is allocating(consistently) only upto  3730.9 MB(3.64 GB).&lt;BR /&gt;&lt;BR /&gt;To overcome the problem, I even tried using -N flg as below, but ld warns and rejects -N flag.&lt;BR /&gt;&lt;BR /&gt;bash-3.00$ cc memtest.c +DA2.0W -N  -o ./memtest&lt;BR /&gt;ld: (Warning) Option "-N" ignored.  Non-shared text is not supported.&lt;BR /&gt;1 warnings.&lt;BR /&gt;&lt;BR /&gt;I still remember, I did use -N option on 32 bit binary and benefited with an increased memory allocation.&lt;BR /&gt;&lt;BR /&gt;Can anybody suggest, if I am missing any important process/system/kernel related configuration or what improvement should be done to enable malloc() to allocate &amp;gt;=4 GB memory.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.&lt;BR /&gt;Srini&lt;BR /&gt;&lt;BR /&gt;PS: Some info, may help...&lt;BR /&gt;&lt;BR /&gt;bash-3.00$ getconf KERNEL_BITS&lt;BR /&gt;64&lt;BR /&gt;&lt;BR /&gt;bash-3.00$ uname -a&lt;BR /&gt;HP-UX unknown B.11.23 U 9000/800 299594728 unlimited-user license&lt;BR /&gt;&lt;BR /&gt;bash-3.00$ ulimit -a&lt;BR /&gt;core file size        (blocks, -c) 2097151&lt;BR /&gt;data seg size         (kbytes, -d) 1048576&lt;BR /&gt;file size             (blocks, -f) unlimited&lt;BR /&gt;max memory size       (kbytes, -m) unlimited&lt;BR /&gt;open files                    (-n) 2048&lt;BR /&gt;pipe size          (512 bytes, -p) 16&lt;BR /&gt;stack size            (kbytes, -s) 8192&lt;BR /&gt;cpu time             (seconds, -t) unlimited&lt;BR /&gt;max user processes            (-u) 257&lt;BR /&gt;virtual memory        (kbytes, -v) unlimited&lt;BR /&gt;bash-3.00$&lt;BR /&gt;&lt;BR /&gt;bash-3.00$ kctune | egrep "max|64"&lt;BR /&gt;aio_listio_max                  256  Default     Immed&lt;BR /&gt;aio_max_ops                    2048  Default     Immed&lt;BR /&gt;aio_prio_delta_max               20  Default     Immed&lt;BR /&gt;dbc_max_pct                      50  Default     Immed&lt;BR /&gt;fr_statemax                  800000  Default     Immed&lt;BR /&gt;fr_tcpidletimeout             86400  Default     Immed&lt;BR /&gt;ftable_hash_locks                64  Default&lt;BR /&gt;io_ports_hash_locks              64  Default&lt;BR /&gt;ksi_alloc_max                 33600  Default     Immed&lt;BR /&gt;ksi_send_max                     32  Default&lt;BR /&gt;max_acct_file_size          2560000  Default     Immed&lt;BR /&gt;max_async_ports                  50  Default&lt;BR /&gt;max_mem_window                    0  Default&lt;BR /&gt;max_thread_proc                 256  Default     Immed&lt;BR /&gt;maxdsiz                  1073741824  Default     Immed&lt;BR /&gt;maxdsiz_64bit            4294967296  Default     Immed&lt;BR /&gt;maxfiles                       2048  Default&lt;BR /&gt;maxfiles_lim                   4096  Default     Immed&lt;BR /&gt;maxssiz                     8388608  Default     Immed&lt;BR /&gt;maxssiz_64bit             268435456  Default     Immed&lt;BR /&gt;maxtsiz                   100663296  Default     Immed&lt;BR /&gt;maxtsiz_64bit            1073741824  Default     Immed&lt;BR /&gt;maxuprc                         256  Default     Immed&lt;BR /&gt;maxvgs                           10  Default&lt;BR /&gt;msgmax                        65535  65535       Immed&lt;BR /&gt;nsysmap64                      8400  Default&lt;BR /&gt;scsi_max_qdepth                   8  Default     Immed&lt;BR /&gt;scsi_maxphys                1048576  Default&lt;BR /&gt;sendfile_max                      0  Default&lt;BR /&gt;shmmax                   1073741824  Default     Immed&lt;BR /&gt;vol_max_bchain                   32  Default&lt;BR /&gt;vol_max_nconfigs                 20  Default&lt;BR /&gt;vol_max_nlogs                    20  Default&lt;BR /&gt;vol_max_nmpool_sz           4194304  Default     Immed&lt;BR /&gt;vol_max_prm_dgs                1024  Default&lt;BR /&gt;vol_max_rdback_sz           4194304  Default     Immed&lt;BR /&gt;vol_max_vol                 8388608  Default&lt;BR /&gt;vol_max_wrspool_sz          4194304  Default     Immed&lt;BR /&gt;vol_maxio                       256  Default&lt;BR /&gt;vol_maxioctl                  32768  Default&lt;BR /&gt;vol_maxkiocount                2048  Default&lt;BR /&gt;vol_maxparallelio               256  Default&lt;BR /&gt;vol_maxspecialio                256  Default&lt;BR /&gt;vol_maxstablebufsize            256  Default&lt;BR /&gt;vol_mvr_maxround                256  Default&lt;BR /&gt;vol_rvio_maxpool_sz         4194304  Default     Immed&lt;BR /&gt;voldrl_max_drtregs             2048  Default&lt;BR /&gt;voliomem_maxpool_sz         4194304  Default&lt;BR /&gt;voliot_iobuf_max              65536  Default&lt;BR /&gt;voliot_max_open                  32  Default&lt;BR /&gt;volpagemod_max_memsz           6144  Default     Immed&lt;BR /&gt;volraid_rsrtransmax               1  Default&lt;BR /&gt;vx_maxlink                    32767  Default&lt;BR /&gt;vxtask_max_monitors              32  Default&lt;BR /&gt;bash-3.00$&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;bash-3.00$ swapinfo -tam&lt;BR /&gt;             Mb      Mb      Mb   PCT  START/      Mb&lt;BR /&gt;TYPE      AVAIL    USED    FREE  USED   LIMIT RESERVE  PRI  NAME&lt;BR /&gt;dev        4096     182    3914    4%       0       -    1  /dev/vg00/lvol2&lt;BR /&gt;reserve       -     155    -155&lt;BR /&gt;memory     2046     964    1082   47%&lt;BR /&gt;total      6142    1301    4841   21%       -       0    -&lt;BR /&gt;bash-3.00$&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;bash-3.00$ vmstat&lt;BR /&gt;         procs           memory                   page                              faults       cpu&lt;BR /&gt;    r     b     w      avm    free   re   at    pi   po    fr   de    sr     in     sy    cs  us sy id&lt;BR /&gt;    1     0     0    79428  242083  135   18    10   49     2    0    75    494   2474   270   4  1 95&lt;BR /&gt;bash-3.00$ iostat&lt;BR /&gt;&lt;BR /&gt;  device    bps     sps    msps&lt;BR /&gt;&lt;BR /&gt;  c2t0d0      0     0.0     1.0&lt;BR /&gt;  c4t0d1      0     0.0     1.0&lt;BR /&gt;&lt;BR /&gt;bash-3.00$&lt;BR /&gt;</description>
      <pubDate>Thu, 01 May 2008 19:14:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/hp-ux-pa2-0-64-bit-malloc-failed-to-allocate-4-gb-memory/m-p/5106686#M690339</guid>
      <dc:creator>scoolj</dc:creator>
      <dc:date>2008-05-01T19:14:06Z</dc:date>
    </item>
    <item>
      <title>Re: HP UX PA2.0 64 Bit / malloc failed to allocate 4 GB memory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/hp-ux-pa2-0-64-bit-malloc-failed-to-allocate-4-gb-memory/m-p/5106687#M690340</link>
      <description>You're almost hitting maxdsiz_64bit -- but are enough lower that I don't think that's the problem (it is 4Gb exactly in your output).&lt;BR /&gt;&lt;BR /&gt;Look at:&lt;BR /&gt;&lt;BR /&gt;bash-3.00$ swapinfo -tam&lt;BR /&gt;Mb Mb Mb PCT START/ Mb&lt;BR /&gt;TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME&lt;BR /&gt;dev 4096 182 3914 4% 0 - 1 /dev/vg00/lvol2&lt;BR /&gt;reserve - 155 -155&lt;BR /&gt;memory 2046 964 1082 47%&lt;BR /&gt;total 6142 1301 4841 21% - 0 -&lt;BR /&gt;&lt;BR /&gt;That malloc requires swap reservations -- and at the time you ran swapinfo you have very little remaining and only 6Gb across the system in any event. I can easily imagine this big malloc hits swap reservation failure -- and hence malloc() fails. Either add more swap or look at the chatr man page -- see if "+dz" is there and how to use it to enable Lazy Swap for the malloc allocation. Note: That would allow you to do the malloc -- but if you actually go to _use_ the space, you'll reserve the swap then.. and if that fails you get killed. So that may not solve your problem.&lt;BR /&gt;&lt;BR /&gt;Longer term and more robustly, you need more memory or more swap (or both).</description>
      <pubDate>Thu, 01 May 2008 19:34:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/hp-ux-pa2-0-64-bit-malloc-failed-to-allocate-4-gb-memory/m-p/5106687#M690340</guid>
      <dc:creator>Don Morris_1</dc:creator>
      <dc:date>2008-05-01T19:34:59Z</dc:date>
    </item>
    <item>
      <title>Re: HP UX PA2.0 64 Bit / malloc failed to allocate 4 GB memory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/hp-ux-pa2-0-64-bit-malloc-failed-to-allocate-4-gb-memory/m-p/5106688#M690341</link>
      <description>Thanks Morris. I will try your suggestions.&lt;BR /&gt;&lt;BR /&gt;I am curious about why -N should be ignored, it worked well with 32 bit programs earlier.&lt;BR /&gt;&lt;BR /&gt;Is it because a 64 bit program has more memory access than 32 bit, MAGIC etc. are applicable only to 32 bit ?&lt;BR /&gt;Or is it because I am using -N for a wrong type of program.&lt;BR /&gt;&lt;BR /&gt;bash-3.00$ cc memtest.c +DA2.0W -N -o ./memtest&lt;BR /&gt;ld: (Warning) Option "-N" ignored. Non-shared text is not supported.&lt;BR /&gt;1 warnings.&lt;BR /&gt;&lt;BR /&gt;Rgds,&lt;BR /&gt;Srini&lt;BR /&gt;</description>
      <pubDate>Thu, 01 May 2008 20:58:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/hp-ux-pa2-0-64-bit-malloc-failed-to-allocate-4-gb-memory/m-p/5106688#M690341</guid>
      <dc:creator>scoolj</dc:creator>
      <dc:date>2008-05-01T20:58:09Z</dc:date>
    </item>
    <item>
      <title>Re: HP UX PA2.0 64 Bit / malloc failed to allocate 4 GB memory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/hp-ux-pa2-0-64-bit-malloc-failed-to-allocate-4-gb-memory/m-p/5106689#M690342</link>
      <description>Yes, that's exactly why -N and other address space layout flags are 32-bit only. 64-bit has one and only one address space layout -- which give you 4Tb on PA to work with for data/stack/private objects. As far as I know, no one has needed 8Tb (which is what a 64-bit EXEC_MAGIC equivalent would be), and I'd seriously expect if they asked for it the answer would be to move to IPF anyway (there's even more architecturally on 64-bit IPF..).&lt;BR /&gt;&lt;BR /&gt;ld_pa(1) covers this with the section of options that are for PA-RISC 32-bit only [which is where -N is listed].</description>
      <pubDate>Thu, 01 May 2008 23:42:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/hp-ux-pa2-0-64-bit-malloc-failed-to-allocate-4-gb-memory/m-p/5106689#M690342</guid>
      <dc:creator>Don Morris_1</dc:creator>
      <dc:date>2008-05-01T23:42:48Z</dc:date>
    </item>
    <item>
      <title>Re: HP UX PA2.0 64 Bit / malloc failed to allocate 4 GB memory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/hp-ux-pa2-0-64-bit-malloc-failed-to-allocate-4-gb-memory/m-p/5106690#M690343</link>
      <description>I have attached a simple program that can demonstrate all the 32bit and 64bit features. On a system with 24GB of swap (and maxdsiz_64 = 40GB), I compiled it with the 64bit option and it easily malloc'ed more than 23GB of virtual memory -- oh, the system had 512 megs of RAM. As you'll see from the comments, 32bit compiler options are quite involved to reach more than 3GB but 64bit is easy.</description>
      <pubDate>Fri, 02 May 2008 00:45:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/hp-ux-pa2-0-64-bit-malloc-failed-to-allocate-4-gb-memory/m-p/5106690#M690343</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2008-05-02T00:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: HP UX PA2.0 64 Bit / malloc failed to allocate 4 GB memory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/hp-ux-pa2-0-64-bit-malloc-failed-to-allocate-4-gb-memory/m-p/5106691#M690344</link>
      <description>Oops, here's the source code attached...</description>
      <pubDate>Fri, 02 May 2008 00:49:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/hp-ux-pa2-0-64-bit-malloc-failed-to-allocate-4-gb-memory/m-p/5106691#M690344</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2008-05-02T00:49:37Z</dc:date>
    </item>
    <item>
      <title>Re: HP UX PA2.0 64 Bit / malloc failed to allocate 4 GB memory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/hp-ux-pa2-0-64-bit-malloc-failed-to-allocate-4-gb-memory/m-p/5106692#M690345</link>
      <description>Hi Morris, Hassel&lt;BR /&gt;&lt;BR /&gt;Thanks much.&lt;BR /&gt;&lt;BR /&gt;Br,&lt;BR /&gt;Srini</description>
      <pubDate>Thu, 22 May 2008 11:17:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/hp-ux-pa2-0-64-bit-malloc-failed-to-allocate-4-gb-memory/m-p/5106692#M690345</guid>
      <dc:creator>scoolj</dc:creator>
      <dc:date>2008-05-22T11:17:58Z</dc:date>
    </item>
    <item>
      <title>Re: HP UX PA2.0 64 Bit / malloc failed to allocate 4 GB memory</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/hp-ux-pa2-0-64-bit-malloc-failed-to-allocate-4-gb-memory/m-p/5106693#M690346</link>
      <description>Thanks.</description>
      <pubDate>Thu, 22 May 2008 11:18:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/hp-ux-pa2-0-64-bit-malloc-failed-to-allocate-4-gb-memory/m-p/5106693#M690346</guid>
      <dc:creator>scoolj</dc:creator>
      <dc:date>2008-05-22T11:18:24Z</dc:date>
    </item>
  </channel>
</rss>

