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.
Tweet
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
=]MARKED AS SPAM BY SLIDE2COMMENT[=
Your blog is very interesting. You write about very interesting things. Thanks for all your tips and information.