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/ line 5337.\cJ” at /usr/local/lib/perl5/5.8.8/ 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

How to revert back to X11 / Xorg from Wayland

Wayland is intended as a “simpler replacement for X”, and is getting quite a bit of hype around the Linux community. So much so, that it’s the default in the latest versions of Fedora, GNOME, KDE and others. While Wayland may be the future, it really is in future. At least for Ubuntu 17.10. The […]

Read More

Touchpad stops working after sleep + resume (Fedora 26 on Dell XPS)

After recently upgrading my Dell XPS 13 w/Touchscreen to Fedora 26, the touchpad suddenly stopped working upon resuming from sleep mode. It was reproduced 100% of the time, and required a complete restart in order to get the touchpad working again. There have been several forum posts and bug reports regarding others experiencing these exact […]

Read More


  • David on Friday, March 23, 2012


    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,

  • vps on Thursday, March 14, 2013

    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 *

Twitter: kireguy

Tweeter button Facebook button Myspace button