<?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: why i cant' shmget() more then 1GB? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/why-i-cant-shmget-more-then-1gb/m-p/3948783#M760950</link>
    <description>Shalom,&lt;BR /&gt;&lt;BR /&gt;Maybe shmmax is set to 1 GB?&lt;BR /&gt;&lt;BR /&gt;SEP</description>
    <pubDate>Wed, 21 Feb 2007 11:31:02 GMT</pubDate>
    <dc:creator>Steven E. Protter</dc:creator>
    <dc:date>2007-02-21T11:31:02Z</dc:date>
    <item>
      <title>why i cant' shmget() more then 1GB?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/why-i-cant-shmget-more-then-1gb/m-p/3948779#M760946</link>
      <description>here is code snippet:&lt;BR /&gt;[... cut ...]&lt;BR /&gt;  const size_t size = (size_t)1024*1024*1024*1+1; // 2GB + 1byte&lt;BR /&gt;&lt;BR /&gt;  shm_handle = shmget(IPC_PRIVATE, size, 0600);&lt;BR /&gt;  if ( shm_handle &amp;lt; 0 ) {&lt;BR /&gt;    perror("shmget()");&lt;BR /&gt;    return 1;&lt;BR /&gt;  }&lt;BR /&gt;  printf("sucessfully allocated shm %dMB\n",size/1024/1024);&lt;BR /&gt;[... cut ...]&lt;BR /&gt;when i try to run prog, i get:&lt;BR /&gt;sergey@archer:~/work$ uname -a&lt;BR /&gt;HP-UX archer B.11.23 U ia64 3177107281 unlimited-user license&lt;BR /&gt;sergey@archer:~/work$ kctune shmmax&lt;BR /&gt;Tunable       Value  Expression  Changes&lt;BR /&gt;shmmax   8556150784  8556150784  Immed&lt;BR /&gt;sergey@archer:~/work$ ./shmmem&lt;BR /&gt;shmget(): Not enough space&lt;BR /&gt;&lt;BR /&gt;why?</description>
      <pubDate>Wed, 21 Feb 2007 10:55:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/why-i-cant-shmget-more-then-1gb/m-p/3948779#M760946</guid>
      <dc:creator>Sergey Akifiev_1</dc:creator>
      <dc:date>2007-02-21T10:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: why i cant' shmget() more then 1GB?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/why-i-cant-shmget-more-then-1gb/m-p/3948780#M760947</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Perhaps (from the shmget()' manpages:&lt;BR /&gt;&lt;BR /&gt;[ENOSPC] - A shared memory identifier is to be created but the system-imposed limit on the maximum number of allowed shared memory identifiers system wide would be exceeded.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Feb 2007 11:12:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/why-i-cant-shmget-more-then-1gb/m-p/3948780#M760947</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2007-02-21T11:12:15Z</dc:date>
    </item>
    <item>
      <title>Re: why i cant' shmget() more then 1GB?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/why-i-cant-shmget-more-then-1gb/m-p/3948781#M760948</link>
      <description>Have you compiled your app as 32-bit or 64-bit (I think the default is 32-bit). IIRC there's a 1GB limit on the quadrant used for shared memory on 32-bit apps. Check which this is using:&lt;BR /&gt;&lt;BR /&gt;file shmmem&lt;BR /&gt;&lt;BR /&gt;EL32 or ELF64?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;Duncan&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Feb 2007 11:27:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/why-i-cant-shmget-more-then-1gb/m-p/3948781#M760948</guid>
      <dc:creator>Duncan Edmonstone</dc:creator>
      <dc:date>2007-02-21T11:27:36Z</dc:date>
    </item>
    <item>
      <title>Re: why i cant' shmget() more then 1GB?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/why-i-cant-shmget-more-then-1gb/m-p/3948782#M760949</link>
      <description>&lt;BR /&gt;So this is a 64-bit application.&lt;BR /&gt;&lt;BR /&gt;You already show shmmax having been set large enough.&lt;BR /&gt;&lt;BR /&gt;What about maxdsiz_64bit and swap space?&lt;BR /&gt;&lt;BR /&gt;Google for: +hpux +shmmax +64-bit ?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Nit picking...&lt;BR /&gt;&lt;BR /&gt;const size_t size = (size_t)1024*1024*1024*1+1; // 2GB + 1byte&lt;BR /&gt;&lt;BR /&gt;Looks like 1GB + 1 to me.&lt;BR /&gt;&lt;BR /&gt;You might want to change the test to print out the MB amount rain or shine.&lt;BR /&gt;&lt;BR /&gt;fwiw,&lt;BR /&gt;Hein.&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Feb 2007 11:28:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/why-i-cant-shmget-more-then-1gb/m-p/3948782#M760949</guid>
      <dc:creator>Hein van den Heuvel</dc:creator>
      <dc:date>2007-02-21T11:28:02Z</dc:date>
    </item>
    <item>
      <title>Re: why i cant' shmget() more then 1GB?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/why-i-cant-shmget-more-then-1gb/m-p/3948783#M760950</link>
      <description>Shalom,&lt;BR /&gt;&lt;BR /&gt;Maybe shmmax is set to 1 GB?&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Wed, 21 Feb 2007 11:31:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/why-i-cant-shmget-more-then-1gb/m-p/3948783#M760950</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2007-02-21T11:31:02Z</dc:date>
    </item>
    <item>
      <title>Re: why i cant' shmget() more then 1GB?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/why-i-cant-shmget-more-then-1gb/m-p/3948784#M760951</link>
      <description>Sergey,&lt;BR /&gt;what are your ulimit values ?&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Feb 2007 11:35:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/why-i-cant-shmget-more-then-1gb/m-p/3948784#M760951</guid>
      <dc:creator>Peter Godron</dc:creator>
      <dc:date>2007-02-21T11:35:00Z</dc:date>
    </item>
    <item>
      <title>Re: why i cant' shmget() more then 1GB?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/why-i-cant-shmget-more-then-1gb/m-p/3948785#M760952</link>
      <description>That's ENOMEM, not ENOSPC:&lt;BR /&gt;&lt;BR /&gt;# cat pig2.c&lt;BR /&gt;#include &lt;STDLIB.H&gt;&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;#include &lt;UNISTD.H&gt;&lt;BR /&gt;#include &lt;SYS&gt;&lt;BR /&gt;#include &lt;STRING.H&gt;&lt;BR /&gt;&lt;BR /&gt;int&lt;BR /&gt;main(int argc, char *argv[])&lt;BR /&gt;{&lt;BR /&gt;        int shmid;&lt;BR /&gt;        void *shmaddr;&lt;BR /&gt;&lt;BR /&gt;        shmid = shmget(IPC_PRIVATE, &lt;BR /&gt;                        (size_t)((1L * 1024L * 1024L * 1024L) + 1L), &lt;BR /&gt;                                IPC_CREAT);&lt;BR /&gt;&lt;BR /&gt;        printf("shmget returned id: %d.\n", shmid);&lt;BR /&gt;&lt;BR /&gt;        if ( shmid == -1 ) {&lt;BR /&gt;                fprintf(stderr, "shmget errno: %d.\n", errno);&lt;BR /&gt;                perror("shmget: ");&lt;BR /&gt;                exit(EXIT_FAILURE);&lt;BR /&gt;        }&lt;BR /&gt;&lt;BR /&gt;        shmaddr = shmat(shmid, NULL, 0);&lt;BR /&gt;&lt;BR /&gt;        if ( shmaddr == SHM_FAILED ) {&lt;BR /&gt;                perror("shmat: ");&lt;BR /&gt;                exit(EXIT_FAILURE);&lt;BR /&gt;        }&lt;BR /&gt;&lt;BR /&gt;        while ( shmaddr != SHM_FAILED ) {&lt;BR /&gt;                bzero(shmaddr, (size_t)(1L * 1024L * 1024L * 1024L));&lt;BR /&gt;                sleep(5);&lt;BR /&gt;        }&lt;BR /&gt;&lt;BR /&gt;        exit(0);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;#kctune shmmax          &lt;BR /&gt;Tunable          Value  Expression     Changes&lt;BR /&gt;shmmax   4398046511104  4398046511104  Immed&lt;BR /&gt;&lt;BR /&gt;# ./pig2&lt;BR /&gt;shmget returned id: -1.&lt;BR /&gt;shmget errno: 12.&lt;BR /&gt;shmget: : Not enough space&lt;BR /&gt;&lt;BR /&gt;And yeah -- that's because you can't create a segment larger than 1Gb in the default 32-bit address space layout. Default layout has 2Gb (on IPF) or 1.75 Gb (PA) available for shared address space, but 1Gb of that is intended for "Global" objects which must be shared across all Memory Windows clients (except those with a Private 4th Quadrant) and with 64-bit clients. That's the upper 1Gb on IPF.&lt;BR /&gt;That will be used when it has to be, but the lower 1Gb lives in a different address space depending on what Memory Window you're in... and as such, objects are not allowed to cross that boundary. Even for applications using an address space model where their 2nd quadrant is also shared still have discrete boundaries between each 1Gb... you can't cross them.&lt;BR /&gt;&lt;BR /&gt;For &amp;gt;1Gb as a single segment, you need to go 64-bit. Your only alternative in 32-bit is to use multiple segments (which aren't guaranteed to be contiguous).&lt;/STRING.H&gt;&lt;/SYS&gt;&lt;/UNISTD.H&gt;&lt;/STDIO.H&gt;&lt;/STDLIB.H&gt;</description>
      <pubDate>Wed, 21 Feb 2007 16:17:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/why-i-cant-shmget-more-then-1gb/m-p/3948785#M760952</guid>
      <dc:creator>Don Morris_1</dc:creator>
      <dc:date>2007-02-21T16:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: why i cant' shmget() more then 1GB?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/why-i-cant-shmget-more-then-1gb/m-p/3948786#M760953</link>
      <description>&lt;BR /&gt;how are you compiling the program &lt;BR /&gt;&lt;BR /&gt;if you do a cc myprog.c -o myprog  &lt;BR /&gt;&lt;BR /&gt;you probably get a 32 bit program.. If you compile it with +DA2.0W &lt;BR /&gt;&lt;BR /&gt;you will get a 64 bit executible.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Feb 2007 22:53:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/why-i-cant-shmget-more-then-1gb/m-p/3948786#M760953</guid>
      <dc:creator>Emil Velez</dc:creator>
      <dc:date>2007-02-21T22:53:33Z</dc:date>
    </item>
    <item>
      <title>Re: why i cant' shmget() more then 1GB?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/why-i-cant-shmget-more-then-1gb/m-p/3948787#M760954</link>
      <description>thnx for replies. the cause was 32bit binary. when rebuilding with `gcc -mlp64 shmmem.c -o shmmem' i was able to grab a 4GB shm segment.&lt;BR /&gt;also my simple memory grabber that doing simple malloc()'ing chubnks of 1MB was able to get around 3GB instead of 811MB in 32bit.</description>
      <pubDate>Thu, 22 Feb 2007 01:57:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/why-i-cant-shmget-more-then-1gb/m-p/3948787#M760954</guid>
      <dc:creator>Sergey Akifiev_1</dc:creator>
      <dc:date>2007-02-22T01:57:40Z</dc:date>
    </item>
  </channel>
</rss>

