inside the mind of a linux admin

Perl module install Out of memory and core dumps

Encountered this gem when I was attempting to install an overly simple/normal perl module (HTML::Template, though all will fail as a result of this). This actually has nothing to do with cPanel, the kernel, or CPAN. Instead, you’re actually hitting a PAM ulimit that is exhausting all of the available reserved memory required to install this module.

Catching error: “Out of memory during \”large\” request for 1052672 bytes, total sbrk() is 106149888 bytes at /usr/local/lib/perl5/5.8.8/CPAN.pm line 5337.\cJ” at /usr/local/lib/perl5/5.8.8/CPAN.pm line 359
CPAN::shell() called at /usr/local/bin/cpan line 198
Going to read /home/xxxxx/.cpan/sources/authors/01mailrc.txt.gz
Out of memory during request for 16400 bytes, total sbrk() is 106149888 bytes!
Lockfile removed.

If you su into the user you’re attempting to install this module for and snap a ulimit -m (max memory size, rss) you’ll see:

max memory size (kbytes, -m) 200000

This is actually limiting the user to a specific amount of available memory, causing the install to fail miserably.

Here’s what you do to fix. Edit /etc/security/limits.conf and allow the user account to use an unlimited amount of memory (temporarily, if you wish):

username hard rss 0

Now do a ulimit -m:

max memory size (kbytes, -m) unlimited

Now, try again:

cpan -i ‘HTML::Template’

And watch it install.

Related Posts

synergy: How to enable crypto (encryption) and generate SSL certificate

The newer Linux versions of the popular mouse/keyboard sharing application “synergy” now has built in encryption. Here’s how to configure it: Just simply passing the –enable-crypto flag on your synergy server without having a proper SSL certificate will result in the inability to connect to clients and generate an error message similar to this in […]

Read More

Change Number Pad Delete (dot) key from a comma in Ubuntu Linux

I recently purchased a new keyboard and updated to the latest Ubuntu, I’m also an avid user of the number pad for quick input when dealing with spreadsheets or accounting. I found that my num pad’s delete key (“.”) was outputting a comma (“,”) instead. Pretty annoying? I agree, but this can be very easily […]

Read More

2 Comments

  • David on Friday, March 23, 2012

    Hello,

    Great article. If you are doing the install as root (say in a CPANEL/VPS environment) you do not have to edit the security file: /etc/security/limits.conf

    You also need to edit 2 parameters. RSS and DATA. You may have an unlimited resident size, but you might have a limit on the size of your data segment.

    At the command line, as root, just do this:

    ulimit -m unlimited
    ulimit -d unlimited

    Then do your install.

    Great site. Take Care,
    David

  • vps on Thursday, March 14, 2013

    =]MARKED AS SPAM BY SLIDE2COMMENT[=
    Your blog is very interesting. You write about very interesting things. Thanks for all your tips and information.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.