http://old.nabble.com/malloc-%28error-code%3D12%29-td21596897.html includes the following:

You may have run out of swap space, but that is unlikely.

The most likely cause is that you have run out of address space.

But they don't give any explanation for that conclusion. My experience is that it is much more likely to run out of swap space than to run out of address space. You can have a ton of little things that add up to taking up all available swap space. To run out of address space, the single process has to exceed something close to 4GB.

A 64-bit OS will allow allocation of huge amounts of VM (via malloc) only if you have sufficient free swap space to back the allocated pages.

It appears that OS X just dynamically resizes swap space so "running out of swap space" probably means "running out of disk space" (at least on the partition that contains the swap directory, which might default to /private/var/vm).

It would be useful to use something like 'top' to watch the size of the process in order to determine how big it is really getting before it fails, instead of just guessing.

- tye        


In reply to Re^2: Running out of address space? (VM) by tye
in thread Running out of address space? by CodeRed

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.