You didn't give us a lot of information. Here are some of my random thoughts on possible causes that i would check:

  1. Are there any security/safety systems active that may view the process as a possible threat or as a possible resource hog? What does your system log (/var/log/syslog and dmesg) say?
  2. On (modern'ish) Linux systems, ulimit isn't the only way to limit RAM allocation. There's also stuff like cgroups.
  3. AppArmor can limit access to system resources on a per-binary config. So your shell may have no limits, but your perl binary might have.
  4. Do you use the system perl or a custom one installed in a home directory. If you use a custom binary, that might have different memory limits than your shell (/usr/bin/* vs. /home/*).
  5. How does the script get started? Manually on the command line? Or by another process that may have lower memory limits (cron, etc) that get inherited by the perl binary?
  6. Without knowing the code you run, it's hard to know exactly what TYPE of memory you are running out of. Does your Perl script fork in any way and run into shared memory issues, for example?
  7. There could also be a problem mmap()ing a huge file into memory, perhaps? Creating a tie'd file in a small tempfs directory?

PerlMonks XP is useless? Not anymore: XPD - Do more with your PerlMonks XP

In reply to Re: Perl script works on Centos but not Ubuntu by cavac
in thread Perl script works on Centos but not Ubuntu by harryhendo

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.