<?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: Out of memory error in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/out-of-memory-error/m-p/3691967#M247377</link>
    <description>Hi Ninad, &lt;BR /&gt;&lt;BR /&gt;You can install 11.11 tusc depot in 11.0, it will work well. Also, have a look at this page to get to know tusc, &lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://h21007.www2.hp.com/dspp/tech/tech_TechDocumentDetailPage_IDX/1,1701,2894,00.html" target="_blank"&gt;http://h21007.www2.hp.com/dspp/tech/tech_TechDocumentDetailPage_IDX/1,1701,2894,00.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;-Arun</description>
    <pubDate>Thu, 15 Dec 2005 06:22:58 GMT</pubDate>
    <dc:creator>Arunvijai_4</dc:creator>
    <dc:date>2005-12-15T06:22:58Z</dc:date>
    <item>
      <title>Out of memory error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/out-of-memory-error/m-p/3691960#M247370</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;While running a perl script we are getting "Out of memory!" error.&lt;BR /&gt;The script is reading a file and populating a hashtable. The file size is around 250 MB. When I monitor the process through glance I can see that it runs till a point of time when it is using around 623 MB and then it exits giving the above mentioned error.&lt;BR /&gt;I have read through previous posts for similar error for which the suggestions are to increase the maxdsiz and/or maxdsiz_64.&lt;BR /&gt;Following are the maxdsiz,maxssiz and maxtsiz params for my server&lt;BR /&gt;maxdsiz        393216   pages &lt;BR /&gt;maxdsiz_64bit  327680   pages       &lt;BR /&gt;maxssiz         98048   pages&lt;BR /&gt;maxssiz_64bit   98048   pages&lt;BR /&gt;maxtsiz         16384   pages&lt;BR /&gt;maxtsiz_64bit  262144   pages&lt;BR /&gt;(pagesize=4096 bytes)&lt;BR /&gt;&lt;BR /&gt;ulimit -a gives&lt;BR /&gt;time(seconds)        unlimited&lt;BR /&gt;file(blocks)         unlimited&lt;BR /&gt;data(kbytes)         1572864&lt;BR /&gt;stack(kbytes)        392192&lt;BR /&gt;memory(kbytes)       unlimited&lt;BR /&gt;coredump(blocks)     4194303&lt;BR /&gt;&lt;BR /&gt;As per the parameters the maxdsiz = 1536 MB, maxssiz = 383 MB ( Hence as per some posts since the programs operate in 1st quadrant or something like that the effective memory left for data area is 1536 - 383 = 1153 MB)&lt;BR /&gt;&lt;BR /&gt;Now my question is that why the program exits at around 623 MB giving out of memory error when ideally it can use upto 1153 MB ?&lt;BR /&gt;&lt;BR /&gt;Also pls suggest what should be the value of the parameters.&lt;BR /&gt;I am attaching the output of sysdef for other kernel parameters.&lt;BR /&gt;&lt;BR /&gt;Your Help much appreciated.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Ninad</description>
      <pubDate>Thu, 15 Dec 2005 05:02:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/out-of-memory-error/m-p/3691960#M247370</guid>
      <dc:creator>Ninad_1</dc:creator>
      <dc:date>2005-12-15T05:02:24Z</dc:date>
    </item>
    <item>
      <title>Re: Out of memory error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/out-of-memory-error/m-p/3691961#M247371</link>
      <description>Shalom Ninad,&lt;BR /&gt;&lt;BR /&gt;perhaps it would be possible to use the tusc utility to run this program. Then you can get a look at what the system says is happening right when it terminates.&lt;BR /&gt;&lt;BR /&gt;If there is a kernel related issue, it probably has to do with memory regions but I can't work the math out to figure out why its failing when it fails.-&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Thu, 15 Dec 2005 05:22:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/out-of-memory-error/m-p/3691961#M247371</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2005-12-15T05:22:25Z</dc:date>
    </item>
    <item>
      <title>Re: Out of memory error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/out-of-memory-error/m-p/3691962#M247372</link>
      <description>Hi Ninad,&lt;BR /&gt;&lt;BR /&gt;First of all, in HP-UX 11.0 those parameter are in Bytes, not pages. I don't know what is your OS version but see in SAM the Description of each of them for a better understanding. &lt;BR /&gt;&lt;BR /&gt;Here are my values as an example:&lt;BR /&gt;&lt;BR /&gt;|| maxdsiz                 536870912    536870912   Static    N/A          M ^ |&lt;BR /&gt;|| maxdsiz_64bit          1073741824   1073741824   Static    N/A          M   |&lt;BR /&gt;|| maxfiles                     1024         1024   Static    N/A          S   |&lt;BR /&gt;|| maxfiles_lim                 1024         1024   Static    N/A          H   |&lt;BR /&gt;|| maxssiz                 134217728    134217728   Static    N/A          M   |&lt;BR /&gt;|| maxssiz_64bit          1073741824   1073741824   Static    N/A          M   |&lt;BR /&gt;|| maxswapchunks               16384        16384   Static    N/A          M   |&lt;BR /&gt;|| maxtsiz                 134217728    134217728   Static    N/A          M   |&lt;BR /&gt;|| maxtsiz_64bit&lt;BR /&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;&lt;BR /&gt;Eric Antunes</description>
      <pubDate>Thu, 15 Dec 2005 05:27:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/out-of-memory-error/m-p/3691962#M247372</guid>
      <dc:creator>Eric Antunes</dc:creator>
      <dc:date>2005-12-15T05:27:14Z</dc:date>
    </item>
    <item>
      <title>Re: Out of memory error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/out-of-memory-error/m-p/3691963#M247373</link>
      <description>SEP,&lt;BR /&gt;&lt;BR /&gt;I do not have tusc utility installed on my server. Can you suggest any other method ? How can I sort out this problem ? Please HELP&lt;BR /&gt;Also can you let me know if my understanding of the parameters correct especially the 1st quadrant and maxdsiz - maxssiz bit ? &lt;BR /&gt;&lt;BR /&gt;Eric,&lt;BR /&gt;&lt;BR /&gt;You are absolutely right. The parameters from SAM for the maxdsiz ... parameters is in bytes , but the parameters I have provided in the post are from the output of the sysdef command which is giving figures in pages.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Ninad</description>
      <pubDate>Thu, 15 Dec 2005 06:02:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/out-of-memory-error/m-p/3691963#M247373</guid>
      <dc:creator>Ninad_1</dc:creator>
      <dc:date>2005-12-15T06:02:09Z</dc:date>
    </item>
    <item>
      <title>Re: Out of memory error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/out-of-memory-error/m-p/3691964#M247374</link>
      <description>Hi Ninad, &lt;BR /&gt;&lt;BR /&gt;You can get tusc from the following location, &lt;BR /&gt;&lt;A href="http://hpux.connect.org.uk/hppd/hpux/Sysadmin/tusc-7.8/" target="_blank"&gt;http://hpux.connect.org.uk/hppd/hpux/Sysadmin/tusc-7.8/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;-Arun</description>
      <pubDate>Thu, 15 Dec 2005 06:06:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/out-of-memory-error/m-p/3691964#M247374</guid>
      <dc:creator>Arunvijai_4</dc:creator>
      <dc:date>2005-12-15T06:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: Out of memory error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/out-of-memory-error/m-p/3691965#M247375</link>
      <description>Arun,&lt;BR /&gt;&lt;BR /&gt;Thanks for the link. Coincidently I was just having a look at that link after searching from google. But binary depot for 11i onwards is only available , whereas my server is running on 11.00. Can you suggest any other alternative ? Any patches need to be installed ?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Ninad</description>
      <pubDate>Thu, 15 Dec 2005 06:16:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/out-of-memory-error/m-p/3691965#M247375</guid>
      <dc:creator>Ninad_1</dc:creator>
      <dc:date>2005-12-15T06:16:53Z</dc:date>
    </item>
    <item>
      <title>Re: Out of memory error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/out-of-memory-error/m-p/3691966#M247376</link>
      <description>Shalom again Ninad,&lt;BR /&gt;&lt;BR /&gt;I'd suggest downloading and compiling the perl source code from &lt;A href="http://www.perl.org" target="_blank"&gt;http://www.perl.org&lt;/A&gt;  or &lt;A href="http://www.cpan.org" target="_blank"&gt;http://www.cpan.org&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Also, if you contact your HP rep or open a support call, I'd say HP has those perl for hpux 11.00 binaries laying around.&lt;BR /&gt;&lt;BR /&gt;I nearly certain we have them but its probably a violation of our support agreement to distribute these files.&lt;BR /&gt;&lt;BR /&gt;The tarball here might work.&lt;BR /&gt;&lt;A href="http://hpux.connect.org.uk/hppd/hpux/Languages/perl-5.8.7/" target="_blank"&gt;http://hpux.connect.org.uk/hppd/hpux/Languages/perl-5.8.7/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Thu, 15 Dec 2005 06:21:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/out-of-memory-error/m-p/3691966#M247376</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2005-12-15T06:21:30Z</dc:date>
    </item>
    <item>
      <title>Re: Out of memory error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/out-of-memory-error/m-p/3691967#M247377</link>
      <description>Hi Ninad, &lt;BR /&gt;&lt;BR /&gt;You can install 11.11 tusc depot in 11.0, it will work well. Also, have a look at this page to get to know tusc, &lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://h21007.www2.hp.com/dspp/tech/tech_TechDocumentDetailPage_IDX/1,1701,2894,00.html" target="_blank"&gt;http://h21007.www2.hp.com/dspp/tech/tech_TechDocumentDetailPage_IDX/1,1701,2894,00.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;-Arun</description>
      <pubDate>Thu, 15 Dec 2005 06:22:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/out-of-memory-error/m-p/3691967#M247377</guid>
      <dc:creator>Arunvijai_4</dc:creator>
      <dc:date>2005-12-15T06:22:58Z</dc:date>
    </item>
    <item>
      <title>Re: Out of memory error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/out-of-memory-error/m-p/3691968#M247378</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I managed to get a depot for 11.00 for perl 5.6.1 , which I installed and ran the script again but still I am getting error,only that the error now I am getting is more elaborate - hope it makes sense to you guys.&lt;BR /&gt;Please can you advice on how I can proceed now ?&lt;BR /&gt;&lt;BR /&gt;The error is "Out of memory during request for 212 bytes, total sbrk() is 668161892 bytes!"&lt;BR /&gt;&lt;BR /&gt;Regs,&lt;BR /&gt;Ninad</description>
      <pubDate>Thu, 15 Dec 2005 09:06:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/out-of-memory-error/m-p/3691968#M247378</guid>
      <dc:creator>Ninad_1</dc:creator>
      <dc:date>2005-12-15T09:06:26Z</dc:date>
    </item>
    <item>
      <title>Re: Out of memory error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/out-of-memory-error/m-p/3691969#M247379</link>
      <description>Unless your Perl executable was compiled and linked with special options, the maximum data segment size limit for the 32-bit process is 1GB even if maxdsiz is larger. Because both the data and stack segments are allocated from the same quadrant, your actual solution is to reduce maxssiz to something like 64MB (and that is generous). Your ~383MB maxssiz reduces the memory available for dynamic memory allocation even if the stack never actually even comes close to that amount.&lt;BR /&gt;</description>
      <pubDate>Thu, 15 Dec 2005 10:08:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/out-of-memory-error/m-p/3691969#M247379</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-12-15T10:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: Out of memory error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/out-of-memory-error/m-p/3691970#M247380</link>
      <description>Clay,&lt;BR /&gt;&lt;BR /&gt;I did a small experiment to understand the parameters and the problem.&lt;BR /&gt;The kern params are&lt;BR /&gt;maxdsiz 1610612736 bytes / 1572864 kbytes&lt;BR /&gt;maxssiz 401604608  bytes / 392192 kbytes&lt;BR /&gt;&lt;BR /&gt;ulimit -a gives &lt;BR /&gt;data 1572864 kbytes&lt;BR /&gt;stack 392192 kbytes&lt;BR /&gt;&lt;BR /&gt;Then I ran the perl script for combination of data and stack sizes using ulimit -d and ulimit -s to set the data and stack sizes.&lt;BR /&gt;Following are the results&lt;BR /&gt;&lt;BR /&gt;-----------------------------------------&lt;BR /&gt;| data(bytes)|stack(bytes)| error(bytes)|&lt;BR /&gt;-----------------------------------------&lt;BR /&gt;| 1610612736 | 401604608  | 668161892   |&lt;BR /&gt;-----------------------------------------&lt;BR /&gt;| 1073741824 | 401604608  | 668161892   |&lt;BR /&gt;-----------------------------------------&lt;BR /&gt;|  524288000 | 401604608  | 512081764   |&lt;BR /&gt;-----------------------------------------&lt;BR /&gt;|  524288000 | 104857600  | 512081764   |&lt;BR /&gt;-----------------------------------------&lt;BR /&gt;|  209715200 | 104857600  | 208076644   |&lt;BR /&gt;-----------------------------------------&lt;BR /&gt;|  104857600 | 104857600  | 104165220   |&lt;BR /&gt;-----------------------------------------&lt;BR /&gt;|   52428800 | 104857600  |  52201316   |&lt;BR /&gt;-----------------------------------------&lt;BR /&gt;| 1610612736 |  67108864  |  668161892  | &lt;BR /&gt;-----------------------------------------&lt;BR /&gt;&lt;BR /&gt;From this I am unable to understand whatever I have read in the earlier posts and what you have stated regarding the use of 1st quadrant , and actual usable space for data = mazdsiz - maxssiz.&lt;BR /&gt;&lt;BR /&gt;If you see the figures the error comes at approx the same bytes the data seg size has been set by ulimit irrespective of the stack size. Only this is not coming true - there seems to be "something" when error comes at around 668161892 bytes irrespective of the data size or the (data size - stack size ). Please see the last line of the table where the data size is around 1536 MB and stack size is around 64 MB as you suggested but still error comes at 637 MB.&lt;BR /&gt;&lt;BR /&gt;Please can you throw some more light.&lt;BR /&gt;&lt;BR /&gt;Regs,&lt;BR /&gt;Ninad</description>
      <pubDate>Thu, 15 Dec 2005 11:11:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/out-of-memory-error/m-p/3691970#M247380</guid>
      <dc:creator>Ninad_1</dc:creator>
      <dc:date>2005-12-15T11:11:33Z</dc:date>
    </item>
    <item>
      <title>Re: Out of memory error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/out-of-memory-error/m-p/3691971#M247381</link>
      <description>First run chatr on your Perl executable and post the results. That will tell me what kind of executable you have.&lt;BR /&gt;&lt;BR /&gt;In the default SHARED_MAGIC 32-bit world, its not quite true that the stack always subtracts from dynamically allocated data. The limit is 1GB (actualy ~960MB because of some other address mapping) for the total but since the the stack and heap are allocated from each end of the 1GB quadrant they don't necessarily collide.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 15 Dec 2005 11:41:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/out-of-memory-error/m-p/3691971#M247381</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-12-15T11:41:52Z</dc:date>
    </item>
    <item>
      <title>Re: Out of memory error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/out-of-memory-error/m-p/3691972#M247382</link>
      <description>Clay,&lt;BR /&gt;&lt;BR /&gt;Please find the output of chatr for perl&lt;BR /&gt;&lt;BR /&gt;chatr /usr/local/bin/perl5.6.1&lt;BR /&gt;/usr/local/bin/perl5.6.1: &lt;BR /&gt;         shared executable &lt;BR /&gt;         shared library dynamic path search:&lt;BR /&gt;             SHLIB_PATH     enabled   first  &lt;BR /&gt;             embedded path  disabled  second Not Defined&lt;BR /&gt;         shared library list:&lt;BR /&gt;             dynamic   /usr/lib/libcl.2&lt;BR /&gt;             dynamic   /usr/lib/libpthread.1&lt;BR /&gt;             dynamic   /usr/lib/libnsl.1&lt;BR /&gt;             dynamic   /usr/lib/libnm.sl&lt;BR /&gt;             dynamic   /usr/lib/libdld.2&lt;BR /&gt;             dynamic   /usr/lib/libm.2&lt;BR /&gt;             dynamic   /usr/lib/libc.2&lt;BR /&gt;             dynamic   /usr/lib/libsec.2&lt;BR /&gt;         dynamic   /usr/local/lib/libiconv.sl&lt;BR /&gt;         shared library binding:&lt;BR /&gt;             deferred &lt;BR /&gt;         global hash table disabled&lt;BR /&gt;         plabel caching disabled&lt;BR /&gt;         global hash array size:1103&lt;BR /&gt;         global hash array nbuckets:3&lt;BR /&gt;         shared vtable support disabled&lt;BR /&gt;         static branch prediction disabled&lt;BR /&gt;         executable from stack: D (default)&lt;BR /&gt;         kernel assisted branch prediction enabled&lt;BR /&gt;         lazy swap allocation disabled&lt;BR /&gt;         text segment locking disabled&lt;BR /&gt;         data segment locking disabled&lt;BR /&gt;         third quadrant private data space disabled&lt;BR /&gt;         fourth quadrant private data space disabled&lt;BR /&gt;         third quadrant global data space disabled&lt;BR /&gt;         data page size: D (default)&lt;BR /&gt;         instruction page size: D (default)&lt;BR /&gt;         nulptr references disabled&lt;BR /&gt;         shared library private mapping disabled&lt;BR /&gt;         shared library text merging disabled&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;But still can you explain why upto 512 MB the error is thrown at approx same size as allocated to data whereas somewhere above 512 MB the error is thrown at around 637 MB whatever the value of data. I am desperate to understand this.&lt;BR /&gt;&lt;BR /&gt;Thanks for your guidance,&lt;BR /&gt;Ninad</description>
      <pubDate>Thu, 15 Dec 2005 11:53:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/out-of-memory-error/m-p/3691972#M247382</guid>
      <dc:creator>Ninad_1</dc:creator>
      <dc:date>2005-12-15T11:53:32Z</dc:date>
    </item>
    <item>
      <title>Re: Out of memory error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/out-of-memory-error/m-p/3691973#M247383</link>
      <description>Chatr indicates that yours is a 32-bit shared executable w/o additional quadrants used for the data segment. This means that ALL static data, stack, and heap (dynamically allocated memory) are confined to the 2nd quadrant. Thus the total of these cannot exceed 1GB --- regardless of the setting of maxdsiz above 1GB. I don't know how you are actually measuring the amount of memory allocated in Perl but I am very suspicious. Also, I haven't bothered to look through the Perl source so I don't know if your ulimit (soft) values are not being overridden by the Perl internally. In short, I don't trust your data.&lt;BR /&gt;&lt;BR /&gt;Instead let's use a known quantity:&lt;BR /&gt;-------------------------------------&lt;BR /&gt;#include &lt;STDIO.H&gt;&lt;BR /&gt;#include &lt;STDLIB.H&gt;&lt;BR /&gt;&lt;BR /&gt;#define CHUNK (1024 * 1024)&lt;BR /&gt;&lt;BR /&gt;#define assign_errno(x) ((errno != 0) ? errno : (x))&lt;BR /&gt;&lt;BR /&gt;extern int errno;&lt;BR /&gt;&lt;BR /&gt;int main()&lt;BR /&gt;{&lt;BR /&gt;  int cc = 0;&lt;BR /&gt;  char *p = NULL;&lt;BR /&gt;  long tot = 0L;&lt;BR /&gt; &lt;BR /&gt;  do&lt;BR /&gt;    {&lt;BR /&gt;      p = (char *) malloc((size_t) CHUNK);&lt;BR /&gt;      if (p != NULL) tot += CHUNK;&lt;BR /&gt;      else cc = assign_errno(-1);&lt;BR /&gt;    }&lt;BR /&gt;  while (p != NULL);&lt;BR /&gt;  (void) printf("Tot: %10ld  Status: %d\n",tot,cc);&lt;BR /&gt;  return(cc);&lt;BR /&gt;}&lt;BR /&gt;--------------------------------------&lt;BR /&gt;Compile it like this:&lt;BR /&gt;cc memtest.c +DD32 -o memtest&lt;BR /&gt;and then chatr memtest to make sure it matches your Perl. There will probably be a difference in SHLIB_PATH and certainly in the shared libraries but these differences are not significant. The code should compile with even the Bundled C compiler.&lt;BR /&gt;&lt;BR /&gt;This guy allocates 1MB of memory at a time until a failure occurs. Your settings of maxdsiz and maxssiz should make more sense with this program.&lt;BR /&gt;&lt;BR /&gt;In any event, it is very dumb to have your stack as large as you have it. Only extremely poorly written code ever needs a stack bigger than 128MB (and this would apply to 64-bit code as well) and the vast majority of code will run happily at 32MB. If I ever need more than 64MB for a stack I have a very serious talk with the developer.&lt;BR /&gt;&lt;BR /&gt;&lt;/STDLIB.H&gt;&lt;/STDIO.H&gt;</description>
      <pubDate>Thu, 15 Dec 2005 14:21:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/out-of-memory-error/m-p/3691973#M247383</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-12-15T14:21:30Z</dc:date>
    </item>
    <item>
      <title>Re: Out of memory error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/out-of-memory-error/m-p/3691974#M247384</link>
      <description>Clay,&lt;BR /&gt;&lt;BR /&gt;You have given me a fantastic program.&lt;BR /&gt;I ran it for several settings for data and stack using ulimit again. Following is the conclusion for others who wish to understand how maxssiz and maxdsiz practically work.&lt;BR /&gt;BUT before that one last question&lt;BR /&gt;I used chatr +q3p memtest to allow memtest to use 3rd quadrant and it worked fine - i.e. I was able to use more than 1 GB memory for data segment.&lt;BR /&gt;Similarly I used chatr for perl to allow using 3rd quadrant - but is this proper and safe method ? Will it cause any problems to my server ? and will this setting be permenant - will it survive across reboots ?&lt;BR /&gt;Clay can you answer this last one for me please ?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Heres the conclusion of maxdsiz and maxssiz.&lt;BR /&gt;As Clay has been rightly saying 32 bit executables use 1st quadrant - only thing is he said the space in 1st quadrant will be lesser than 1 GB - I found out that it is 1023 MB (i.e. 1 Mb less than 1 GB).&lt;BR /&gt;When we define the maxdsiz and maxssiz - this defines the max stack size equal to value of maxssiz and max data seg size to (1 GB - 1 MB - maxssiz) or (maxdsiz - 1 MB) which ever is lesser.&lt;BR /&gt;To explain with an example (These values may not be practically correct to be defined - as in my case maxssiz is 383 MB which is far too high than practically required) &lt;BR /&gt;1. if maxssiz is set to 383 MB and maxdsiz to 800 MB - we will get max stack size = 383 MB BUT the max data size = 1GB - 1MB - maxssiz = 640 MB (even though maxdsiz is set to 800 MB)&lt;BR /&gt;2. if maxssiz is set to 64 MB and maxdsiz to 800 MB - we will get max stack size=64 Mb and max data size = maxdsiz - 1 MB = 799 MB  &lt;BR /&gt;&lt;BR /&gt;We can use ulimit to define data or stack size for the environment you are working in - we can set data size max upto the value defined for maxdsiz and can set max stack size upto the value defined for maxssiz. But again practically the max stack size available will be equal to the value defined by ulimit (as is logical) but the max data size available will be equal to (1GB - 1MB - maxssiz ) and not (1GB - 1 MB - max stack size set by ulimit) &lt;BR /&gt;&lt;BR /&gt;Thanks everyone for their help(especially Clay - u r great).&lt;BR /&gt;&lt;BR /&gt;Ninad</description>
      <pubDate>Thu, 15 Dec 2005 17:34:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/out-of-memory-error/m-p/3691974#M247384</guid>
      <dc:creator>Ninad_1</dc:creator>
      <dc:date>2005-12-15T17:34:23Z</dc:date>
    </item>
    <item>
      <title>Re: Out of memory error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/out-of-memory-error/m-p/3691975#M247385</link>
      <description>Yes, your chatr command actually modifies the executable so the changes are preserved across reboots. Also, note that I said that DATA for shared executables is confined to the 2ND Quadrant not the 1ST. The 1st quadrant is used for the program's text (instructions). The +q3p enable chatr option extends the data into Q3 as well but at a cost. This reduces the space normally available for shared library code, shared memory-mapped files and possibly shared memory. Your perl executable should be fine with this chatr option.</description>
      <pubDate>Thu, 15 Dec 2005 17:47:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/out-of-memory-error/m-p/3691975#M247385</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2005-12-15T17:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: Out of memory error</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/out-of-memory-error/m-p/3691976#M247386</link>
      <description>To add a bit to Clay's program, I've attached a similar program that has instructions on how to make the program grab 900, 1700, 2700 and 3700 megs when compiled in 32bit mode, and essentially unlimited RAM in 64bit mode (I quit testing when the program grabbed 47Gb on a 2Gb D-class box). I will also strongly agree about the stack size. There is no good reason to have a program stack that exceeds 20-40 megs. The vast majority of programs use less than 10 megs.</description>
      <pubDate>Thu, 15 Dec 2005 19:47:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/out-of-memory-error/m-p/3691976#M247386</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2005-12-15T19:47:09Z</dc:date>
    </item>
  </channel>
</rss>

